I am having trouble running a Levene Test on an Anova. I keep getting the following error:
'Error in y - meds[group] : non-conformable arrays'
Here is what I have:
MiniP$Education <- as.factor(MiniP$US_DEGR)
MiniP$Sex <- as.factor(MiniP$SEXM1F2)
leveneTest(Immigration~Education*Sex, data = MiniP)
Sex has 2 levels, Male and Female, and education has 5 levels, ranging from HS Dropout to Grad School.
For males by education level, I have (68, 286, 44, 123, 66) and for females by education level, I have (92, 330, 69, 118, 75). I've tried setting my predictors to numeric and to factors.
I get that reproducible examples are helpful, but after reading the documentation shared in the comments, it appears that you need to include a data frame to make the example reproducible (understandably). However, the dataset that I am using has over 1200 cases. So I don't know how to provide that here. The code that I have isn't broken, it works on other datasets and variables, but for some reason, it won't work on this equation. I've tried setting my predictors to numeric and to factors.