Hello everyone, this is my first Statalist post. I am trying to use the margins command after an OLS regression model with weighted data and full information maximum likelihood (FIML). I am also including an interaction term in my model. When I tried to run the margins command, there was an error message saying " factor XXX not found in list of covariates." XXX is my main IV variable, here it is TV time (0= low, 1=medium, 2=high hours). Can anyone help me and let me know where the problem is and how to fix it?
I am trying to find out whether the effect of tv_time on depression varies by age. In the following model, agexlow, agexmid, and agexhigh are the mannually created interaction terms between age and tv_time.
My codes are as follows:
xi: sem (depress <- i.tv_time age agexlow agexmid agexhigh i.gender i.race i.educ) [pw=weight], method (mlmv)
margins tv_time, at(age=(17(10)98)) vsquish
Thanks a lot in advance!
I am trying to find out whether the effect of tv_time on depression varies by age. In the following model, agexlow, agexmid, and agexhigh are the mannually created interaction terms between age and tv_time.
My codes are as follows:
xi: sem (depress <- i.tv_time age agexlow agexmid agexhigh i.gender i.race i.educ) [pw=weight], method (mlmv)
margins tv_time, at(age=(17(10)98)) vsquish
Thanks a lot in advance!
Comment