[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

# st: AW: RE: AW: computing interaction effects after xtprobit

 From "Martin Weiss" To Subject st: AW: RE: AW: computing interaction effects after xtprobit Date Tue, 31 Mar 2009 13:33:14 +0200

```<>

Just to elaborate on the -unab- thing:

*************
*generate example
clear*
set obs 1000

forv i=1/10{
g ind`i'=0
}

*initialize
local calc  xb = _b[_cons] + _b[cps]*cps + _b[rz]*rz + _b[cpsrz]*cpsrz +
_b[share]*share

*unabbreviate
unab mylocal: ind*

*add them to calc
foreach var of local mylocal{
local calc `calc' + _b[`var']*`var'
}

*check result
di "`calc'"
*************

HTH
Martin

Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von
I.Roland@lse.ac.uk
Gesendet: Dienstag, 31. März 2009 13:06
An: statalist@hsphsun2.harvard.edu
Betreff: st: RE: AW: computing interaction effects after xtprobit

Hi Martin/Austin

Thanks for this. I am trying to replicate what -inteff- does with
-predictnl- for my model.

My variables are as follows:

y binary dependent variable
cont1 continuous independent variable
cont2 continuous independent variable
inter: cont1*cont2
cont3 continuous independent variable

The RE probit is:

xtprobit y cont1 cont2 inter cont3, i(group)

Based on Norton and Ai (2004, p.158), I then use the following code to
compute the interaction effect:

local xb = _b[_cons] + _b[cont1]*cont1 + _b[cont2]*cont2 + _b[inter]*inter +
_b[cont3]*cont3
local coef = _b[inter] - (_b[cont1]+_b[inter]*cont2)*(_b[cont2] +
_b[inter]*cont1)*(_b[_cons] + _b[cont1]*cont1 +_b[cont2]*cont2 +
_b[inter]*inter + _b[cont3]*cont3)
predictnl interac = (`coef')*(normden(`xb')), se(se_interac)
sum interac se_interac
That runs fine but delivers a constant interaction effect. Forgive my
ignorance, but could this be because it ignores the unobserved random
effects?
Alternatively, I would like to estimate a FE probit - same model as above
but with indicator variables (identified by group in the RE model). This
approach may be better since it is not possible to capture the unobserved
random effects. I have a lot of indicator variables and would like to find
an easy way to capture them in the code that I need to run to compute the
interaction effect. It seems it is not possible to use the usual truncation
* in the code (see code I tried below where ind* captures all the
indicators).
local xb = _b[_cons] + _b[cps]*cps + _b[rz]*rz + _b[cpsrz]*cpsrz +
_b[share]*share + _b[ind*]*(ind*)
Thanks a lot for your advice!
________________________________________
From: owner-statalist@hsphsun2.harvard.edu on behalf of Martin Weiss
Sent: Fri 27/03/2009 17:07
To: statalist@hsphsun2.harvard.edu
Subject: st: AW: computing interaction effects after xtprobit

<>

http://www.stata-journal.com/sjpdf.html?articlenum=st0063, page 156 says
that you can replicate anything -ssc d inteff- does via -predictnl-.

HTH
Martin

-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von
I.Roland@lse.ac.uk
Gesendet: Freitag, 27. März 2009 18:02
An: statalist@hsphsun2.harvard.edu
Betreff: st: computing interaction effects after xtprobit

Hello Statalisters,

I would like to estimate a random-effects probit that includes an
interaction term between two continuous independent variables. After the
command 'probit', 'inteff' can be used to compute the correct interaction
effects. However, it does not seem to work after 'xtprobit'. Does anyone
know how to compute interaction effects after 'xtprobit'?

Thanks in advance!

Please access the attached hyperlink for an important electronic
communications disclaimer:
http://www.lse.ac.uk/collections/secretariat/legal/disclaimer.htm

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Please access the attached hyperlink for an important electronic
communications disclaimer:
http://www.lse.ac.uk/collections/secretariat/legal/disclaimer.htm

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```

 © Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index