Hello Martin,
Following your advice below, I used predictnl in order to get the whole vector of predictions.
predictnl linearpred = _b[_cons] + _b[cont1]*cont1+ _b[cont2]*cont2+ _b[inter]*inter+ _b[cont3]*cont3
predictnl coef = _b[inter] - (_b[cont1]+_b[inter]*cont2)*(_b[cont2] + _b[inter]*cont1)*(linearpred)
I then computed the interaction effect as follows
predictnl interact = coef*(normden(linearpred))
This works fine. I would like to compute the significance of this interaction effect. Can options of the predictnl command be used for that (eg p() )?
Thanks for your advice!
________________________________
From: [email protected] on behalf of Martin Weiss
Sent: Tue 31/03/2009 12:18
To: [email protected]
Subject: st: AW: RE: AW: computing interaction effects after xtprobit
<>
I am not an expert in these issues so you should pay closer attention to
Austin`s remarks than mine.
What I do understand from your code sample is that you are trying to store a
vector of values in a -local- which is bound to end in tears. Take the line
***
local coef = _b[inter] - (_b[cont1]+_b[inter]*cont2)*(_ ...
****
What is Stata supposed to make of "cont2"? By default, it assumes the first
value of "cont2", multiplies out the product with the coefficients you
specified and stores this _one_ value in the local. This may be what you
want, but I doubt it.
If you want the whole vector of predictions, use -predict- itself. You may
also want to look at -adjust- as a front-end for -predict-. See Brian`s
http://www.stata.com/support/faqs/stat/adjust.html
Incidentally, you are right that you cannot take shortcuts such as "*" in
these calculations but have to spell them out. -h unab- may be your friend
in preprocessing a -varlist-...
HTH
Martin
Von: [email protected]
[mailto:[email protected]] Im Auftrag von
[email protected]
Gesendet: Dienstag, 31. März 2009 13:06
An: [email protected]
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: [email protected] on behalf of Martin Weiss
Sent: Fri 27/03/2009 17:07
To: [email protected]
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: [email protected]
[mailto:[email protected]] Im Auftrag von
[email protected]
Gesendet: Freitag, 27. März 2009 18:02
An: [email protected]
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/
Please access the attached hyperlink for an important electronic communications disclaimer: http://www.lse.ac.uk/collections/secretariat/legal/disclaimer.htm
<<winmail.dat>>