Hi, all! I'm running into a weird regression error that I hoped you could help with?
I'm trying to use the lm.beta function to get the standardized betas on a regression.
Regression_GenderAndInstructor<-lm(PercFail ~ GENDER2 + INSTRUCTOR2 + GENDER2*INSTRUCTOR2, data=FYW4)
The error is below:
Error in var(if (is.vector(x) || is.factor(x)) x else as.double(x), na.rm = na.rm) :
Calling var(x) on a factor x is defunct.
Use something like 'all(duplicated(x)[-1L])' to test for a constant vector.
This is educational data; gender & instructor are both categorical variables. While I realize the regression is not always an ideal instrument with categorical variables, it should work and my instructor is encouraging me to use this.
When my instructor runs the exact same code on the exact same data, she does not get an error. I do. Suggestions for what to fix?
Thanks in advance! I am SUPER new to R so appreciate any help.