I am running a cross classified (logistic) age period cohort model. Periods and cohort are assumed to be “crossed” with one another instead of being nested within one another. As I now have the regression results I would like to graph the predicted probabilities of my outcome variable (binary 0=Yes, 1=No) for the random components (period and cohort) and for age.
Below is the code I ran for my model and calculating deviance (to determine goodness of fit):
Code:
meqrlogit bino1 c.Age##c.Age i.education i.employment i.parent income Nchild || _all:R.Period || Cohort:, laplace or predict dev, dev gen dev22 = dev^2 qui sum dev22 di "Deviance = " r(sum) " = " -2*e(ll)
Code:
predict fe, xb predict re, reses gen fere = fe + re gen lowconf = fere - 1.96*reses gen uppconf = fere + 1.96*reses
I am unsure how to correctly get the predictions and then plot them in a line graph to better visualize the age period and cohort effects on my outcome variable?
Any help is appreciated.
0 Response to Plotting random and fixed effects using cross-classified logistic model (meqrlogit)
Post a Comment