Help with error on finding standardized betas for regression?

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.

Code
Regression_GenderAndInstructor<-lm(PercFail ~ GENDER2 + INSTRUCTOR2 + GENDER2*INSTRUCTOR2, data=FYW4)
summary(Regression_GenderAndInstructor)
lm.beta(Regression_GenderAndInstructor)

Error
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.

Note
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.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.