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
Workshop on interpreting intetraction effectsWorkshop: Interpreting Interaction Effects with ICALC March 29-30, 2019 Philadelphia Instructor: Ro…
threshold, gaps not allowedHi everyone, I'm doing threshold model with the command "threshold" in Stata15.1, my data is strong…
Predicting residuals of an EGARCH model for panel data using rangerun/rangestatHello Statalisters, My data is daily panel data that consists of 379 firms: Code: * Example gene…
Difference between catplot and tabplotDear Stata users, I have a dataset comprised of two variables, the foobarx variable is what I conce…
I created a YouTube video on using CODE delimiters & dataex – looking for feedback on making it betterHi everyone, It seems like using the CODE delimiters and -dataex- is a hurdle for new posters (part…
Subscribe to:
Post Comments (Atom)
0 Response to Visualizing cross-level interaction in a mixed model
Post a Comment