I'm running Clarify in order to generate confidence intervals for a
multinomial logit model with multiple interaction terms. I am able to run
the estsimp portion of the Clarify commands and successfully complete the
replications, but when I run the do-file I've created in order to set the
values of the interaction terms, Stata crashes. (By crashing, I mean that
Stata says that an error has occurred and shuts down completely.) It's not
consistent in its crashing (that is, I'm sometimes able to generate a few
predicted probabilities), but invariably it crashes before I have what I
need. I'm attaching the portion of the do-file that is of interest.
**Basic model with interactions, multiple responses excluded
estsimp mlogit mip_dv black male edu01 age01 news_for news_gov news_mis
news_rac news_soc news_vna b_x_for- b_x_vna m_x_for- m_x_vna ed_x_for-
ed_x_vna a_x_for a_x_gov a_x_mis a_x_rac a_x_soc a_x_vna if limsamp==1,
b(0)
**Set values
setx mean
setx edu01 mean if limsamp==1
setx age01 mean if limsamp==1
setx black 0
setx male 0
tempname predprob
postfile predprob pp_for_m pp_for_lo pp_for_hi newsflow educ using
"c:\clarify_interact_1.dta", replace
gen maxflow=.45
*Varying news vars
local i=0
while `i' <=maxflow+.02 {
*Adjust mean values
setx edu01 0
setx news_for mn_n_for+((mn_n_for-`i')/6)
setx news_vna mn_n_vna+((mn_n_for-`i')/6)
setx news_gov mn_n_gov+((mn_n_for-`i')/6)
setx news_rac mn_n_rac+((mn_n_for-`i')/6)
setx news_soc mn_n_soc+((mn_n_for-`i')/6)
setx news_mis mn_n_mis+((mn_n_for-`i')/6)
local btemp=0
setx b_x_for `btemp'*news_for
setx b_x_vna `btemp'*news_vna
setx b_x_gov `btemp'*news_gov
setx b_x_rac `btemp'*news_rac
setx b_x_soc `btemp'*news_soc
setx b_x_mis `btemp'*news_mis
local mtemp=0
setx m_x_for `mtemp'*news_for
setx m_x_vna `mtemp'*news_vna
setx m_x_gov `mtemp'*news_gov
setx m_x_rac `mtemp'*news_rac
setx m_x_soc `mtemp'*news_soc
setx m_x_mis `mtemp'*news_mis
local etemp=0
setx ed_x_for `etemp'*news_for
setx ed_x_vna `etemp'*news_vna
setx ed_x_gov `etemp'*news_gov
setx ed_x_rac `etemp'*news_rac
setx ed_x_soc `etemp'*news_soc
setx ed_x_mis `etemp'*news_mis
summarize age01 if limsamp==1, meanonly
local atemp=`r(mean)'
setx a_x_for `atemp'*news_for
setx a_x_vna `atemp'*news_vna
setx a_x_gov `atemp'*news_gov
setx a_x_rac `atemp'*news_rac
setx a_x_soc `atemp'*news_soc
setx a_x_mis `atemp'*news_mis
**Simulate predicted probabilities and post means and confidence intervals
to separate file
local name=`i'*100
simqi, prval(1) genpr(pp_for_`name')
summarize pp_for_`name', meanonly
replace pp_for_m=r(mean)
_pctile pp_for_`name', p(2.5, 97.5)
replace pp_for_lo = r(r1)
replace pp_for_hi = r(r2)
replace newsflow=`i'
post predprob(pp_for_m) (pp_for_lo) (pp_for_hi) (newsflow) (educ)
local i=`i'+.05
}
postclose predprob
Show replies by date