[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: predictnl, marginal effects and interaction effects
Dear Stata List,
I am using a probit model on cross sectional survey data(Stata version 9.2).
I would like to calculate the interaction effects and marginal effects for
two of my dummmies-pipewaterdummy and wellwaterdummy. I am using the
-predictnl- command. However, I need to derive the interaction effects and
marginal effects and then use -predictnl-. I looked at an example in
StataFAQ but my model has interaction terms arising from two water dummies
which is more complex than shown in the example and I am stuck here. I would
very grateful if someone could please help me out. I do not have access to a
Statistician, so I would be really grateful for someone's advice.
My question is : (1) when calculating the Marginal effects of,
say pipewaterdummy, do I keep all the other variables, continuous and
dummies, including those in the other interaction terms (i.e. those not
involving pipewaterdummy such as the terms age*wellwaterdummy and
wealthlowdummy*wellwaterdummy) at their mean values?
(2) Could someone please help me in the correct derivation of interaction
effect. I am at a complete loss-I have made an attempt but am not sure
whether it is correct.
I show below my model and attempts at deriving marginal and interaction
effects using Stata codes.
My model :
Diarrhoea: Dependant (binary variable):
Age: continuous variable
Wealthlowdum pipewaterdummy wellwaterdummy: dummies
Y(binary)= c+ age + wealthlowdummy
+ pipewaterdummy + age*pipewaterdummy + wealthlowdummy*pipewaterdummy
+ wellwaterdummy + age*wellwaterdummy + wealthlowdummy*wellwaterdummy
svy: probit diarrhoea age wealthlowdum pipewaterdummy age*pipewaterdummy
wealthlowdummy*pipewaterdummy wellwaterdummy age*wellwaterdummy
*To calculate Marginal effect of pipedwater dummy:
local xb1 _b[age]*`meanage'+_b[wealthlowdummy]*`meanwealthlowdummy'+
local xb0 _b[age]*`meanage'+_b[wealthlowdummy]*`meanwealthlowdummy'
*Marginal Effect of piped water dummy
predictnl ddiarrdpipe1= normal(`xb1')-normal(`xb0') in 1, se(sepipe)
*To calculate Interaction Effect of pipedwater dummy with agen and
predictnl ddiarrdpipeage = normalden(`xb1')*(_b[age] +_b[agepipewaterdummy]
+ _b[agewellwaterdummy] ) - normalden(`xb0')(_b[age] +
_b[agewellwaterdummy]) in 1, se(sepw) /*Is this correct?*/
predictnl ddiarrdpipewealth = normalden(`xb1')*(_b[wealthlowdummy] +
_b[wealthlowdummypipewaterdummy] + _b[wealthlowdummywellwaterdummy] ) -
normalden(`xb0')(_b[wealthlowdummy] + _b[wealthlowdummywellwaterdummy] ) in
/*Is this correct?*/
I would very grateful for your help.
Express yourself instantly with MSN Messenger! Download today it's FREE!
* For searches and help try: