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 NAs in any of the entries. I used the following command to eliminate NAs:
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 NAs that might be causing the problem
 
     
    