Hello,
I want to run a regression and subsequent prediction separately for 23 independent variables . I hereby use a negative binomial regression in a survey context.
Without a macro the syntax would be:
svy:nbreg av_tot_cost1 b2.bmi_class b1.age3c i.hc04 ib(freq).et_1 I.ma0101, baselevels irr
predict p_ma0101
svy:nbreg av_tot_cost1 b2.bmi_class b1.age3c i.hc04 ib(freq).et_1 I.ma0102, baselevels irr
predict p_ma0102
.... up to ma0123
I have run the following macro but get the comment 'invalid syntax'
foreach disease of ma0101 ma0102 ma0103 ma0104 ma0105 ma0106 ma0107 ma0108 ma0109 ma0110 ma0111 ma0112 ma0113 ma0114 ma0115 ma0116 ma0117 ma0118 ma0119 ma0120 ma0121 ma0122 ma0123 {
svy:nbreg av_tot_cost1 b2.bmi_class b1.age3c i.hc04 ib(freq).et_1 i.`disease', baselevels irr
predict p_$disease}
Can someone help me to correctly adapt the code?
Thank you in advance
Related Posts with Macro regression with survey context
Installing gtools package on a remote computer (with no admin access)Hello, I am working on a Remote Stata Server (OS: Windows Server 2016 Standard) with Stata/SE 15.1. …
how to simplify the syntax? Code: keep if pvalueInter<.1 & pvalueMed1<.1 & pvalueMed2<.1 & pvalueMed3<.…
Missing values when generating lagged variable in panel dataContext: I'm using Stata 16.1 on Window 10. I have unbalanced panel data with 52 variables and 953 o…
Same id but do not get matched (merge)Dear all, I have a problem that I do not understand why it is occuring. I want to merge two data fil…
Clear Memory ProblemI am working on timeseries data of different states. to check if the prices are stationary for each …
Subscribe to:
Post Comments (Atom)
0 Response to Macro regression with survey context
Post a Comment