Open YouriLMora opened 4 years ago
A solution I found was to convert all variables (even IVs) as numeric. It appears that even the variable cluster cannot be factors ?
Thanks for bringing this to my attention! I'll take a look and post updates here as I solve the issue.
Hello! I'm getting the same error -- I have a mix of continuous (numeric) and factor-level variables as predictors in my model. The outcome (DV) is continuous. Curious if there are any updates on this!
Hello! For now, you would need to manually change your factor-level predictors to numerical variables (except the clustering variable, which you can leave as a factor.) Let me know if you try that, and if it works or you run into a different issue.
I recognize the usefulness and interest in allowing the model to accept factors as predictors, and plan to incorporate it in future versions of the package. But for now, the package isn't build to deal with factor variables as predictors. This error it generates -- "Your data must be numeric. Only the cluster variable can be a factor." -- is generated on purpose, it's not the code making a mistake.
Hi, all of my predictors are numeric and I am encountering this issue. My syntax is posted below. For what it's worth, the interaction terms are computed in the model but they are not separate variables in the dataset (i.e., there is no column for stigma_wp*CORE_c). However, I ran a simplified model with no interaction terms, and the same issue came up. The asterisks in the below model are spaced out for formatting issues; they are next to each other in R.
total <- lmerTest::lmer(WAI_Total ~ 1 + Session_c + stigma_c CORE_c + stigma_c CORE_wp + stigma_wp CORE_c + stigma_wp CORE_wp + (1|UniqueID), data = threesessions_noNA, na.action=na.omit, REML=FALSE, control=lmerControl(optimizer="Nelder_Mead",optCtrl=list(maxfun=2e5))) r2mlm(total)
data.frame': 177 obs. of 6 variables: $ UniqueID : num $ Session_c: num $ WAI_Total: num . $ CORE_c : num [1:177, 1] ..- attr(, "scaled:center") $ CORE_wp : num $ stigma_c : num ..- attr(, "scaled:center") $ stigma_wp: num
Hey,
Thanks a lot for this package !
I get the following error message though :
All the independent variables in the model are factors, except for the participants (numeric)
The depedent variable (rt.log) is also numeric.
Maybe my way of typing the model is not appropriate for pulling the variables ?
model.dt.r2 = lmer(rt.log ~ bloc.GFL * bloc.congruence