Dear STATAlist,
I have a, hopefully simple, query about storing parameters post estimation.
I am doing the following to obtain odds of a binary outcome (tenmm) and mean age, both with standard errors, from models adjusted for the clustered way in which subjects were sampled...
xtset TBSchool
xtlogit tenmm, re or
predict A, xb
predict B, stdp
quadchk, nooutput
xtset, clear
xtreg v1age if tenmm!=., i(TBSchool) re
predict C, xb
predict D, stdp
The values are then fed through into subsequent calculations. That works fine.
I now wish to repeat the same thing for separate strata - by gender, age group, etc. The simple thing to do would be to repeat the regression models, restricted to subjects in that strata. However, I think that would result in the data being used to evaluate clustering being different in each subgroup.
Does adding an if statement into the predict command after running the regression model with all subjects, work?
e.g.
xtlogit tenmm, re or
predict A if gender==1, xb
Thanks,
Tom
I have a, hopefully simple, query about storing parameters post estimation.
I am doing the following to obtain odds of a binary outcome (tenmm) and mean age, both with standard errors, from models adjusted for the clustered way in which subjects were sampled...
xtset TBSchool
xtlogit tenmm, re or
predict A, xb
predict B, stdp
quadchk, nooutput
xtset, clear
xtreg v1age if tenmm!=., i(TBSchool) re
predict C, xb
predict D, stdp
The values are then fed through into subsequent calculations. That works fine.
I now wish to repeat the same thing for separate strata - by gender, age group, etc. The simple thing to do would be to repeat the regression models, restricted to subjects in that strata. However, I think that would result in the data being used to evaluate clustering being different in each subgroup.
Does adding an if statement into the predict command after running the regression model with all subjects, work?
e.g.
xtlogit tenmm, re or
predict A if gender==1, xb
Thanks,
Tom
Comment