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
difference to difference-introduction of minimum wage in a specific yearDear users, As part of my coursework i am analysing the effect of introduction of minimum wage on e…
Question about reghdfe commandDear all.When we use reghdfe to run pannel fixed-effects model,which kind of Rsq should we report in…
mean comparison with sample weights (pweight)Dear all, I want to perform mean comparisons across groups. I also want to apply sample weights (pw…
Loop over variable with placeholderHello, while trying some thing out, I got an error message for the following loop: local recode2 h…
-xtoverid-Dear Statalists, I am new here and need help to download the community-contributed command -xtoveri…
Subscribe to:
Post Comments (Atom)
0 Response to Visualizing cross-level interaction in a mixed model
Post a Comment