Dear All,
Apologies in advance if I am not including all necessary information, this is my first time posting here.
I am trying to plot a cross-level interaction of a categorical and a continuous outcome in a mixed model. I keep getting the following error with marginsplot: "using variable VACANT5 as a factor variable and a regular variable is not supported" and I am not sure how to resolve this.
My code for the model is as follows (note VACANT5 is a dichotomous variable and age is continuous):
mixed BMI age VACANT5 VACANT5#c.age|| CD:age, var covar(un)
I then tried to run margins for the interaction term:
margins VACANT5#c.age
but kept getting the error: "only factor variables and their interactions are allowed"
so I ran it as follows:
margins VACANT5, at (age=(18(2)100))
this worked, but I still can't get it to plot (getting the error listed above).
Any ideas of what I'm doing wrong or how else to get this to work?
Thanks!
Related Posts with Visualizing cross-level interaction in a mixed model
Identify/test differences across groupsDear Statalist, I have an unbalanced panel with ca. 200 firms, and between 3-8 years of data for ea…
Consultation on regression model with dichotomous variable taken in a longitudinal period ( 2014-2018) Good evening I am new with STATA and I have a query, If I have a dichotomous outcome, but my study …
Table to bar graph. How to convert tabel data into a graph using STATA. in this exmaple, the table can easily be conve…
return all estimated coefficients for all regressions in the bootstrap?Dear All, Suppose that I do the following bootstrap (please ssc install reghdfe) Code: set seed 12…
Is vce(cluster) option robust to cross-sectional dependence?Hi All, I recently heard that -vce(cluster)- option in -xtreg- robust to cross-sectional dependence.…
Subscribe to:
Post Comments (Atom)
0 Response to Visualizing cross-level interaction in a mixed model
Post a Comment