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
Creating Control Variable using IPUMS CPSHey guys, I am currently trying to do a regression with panel data from the IPUMS CPS. I have mostl…
How can I make these codes more compact using foreach/forvalues/local etc.?Hi everyone, I am sure there must have been a way to make the following codes more compact but no m…
Max function doesn't return the exact resultHello, I have a problem with the max() function. I have a dataset with several variables and one of…
Matched data for regressionI am new to STATA. I am working on DHS dataset. I have merged the men recode file with the individua…
Estimating propensity scores after multiple imputationHi there, I am estimating propensity scores using logistic regression on an imputed dataset (M=10).…
Subscribe to:
Post Comments (Atom)
0 Response to Visualizing cross-level interaction in a mixed model
Post a Comment