On running a glm
model I encountered a strange error message which I am unable to understand. The error message was
Error in model.frame.default(formula = case ~ MENSTRUALSTATUS + PARITY + : variable lengths differ (found for 'PD')
when I run the following code:
lr.PD <- glm(case ~ MENSTRUALSTATUS + PARITY + k_BMI + PD, family = "binomial",
data = teData.volpara)
The dataframe teData.volpara
has no NA
s in any of the entries. I used the following command to eliminate NA
s:
teData.volpara <- teData[complete.cases(teData),]
I found a similar question here: Error in model.frame.default ...... variable lengths differ but I can't seem to find any NA
s that might be causing the problem