Error in model.frame.default … variable lengths differ (but no NAs in data)

一世执手 提交于 2019-12-12 03:14:16

问题


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

来源:https://stackoverflow.com/questions/29220727/error-in-model-frame-default-variable-lengths-differ-but-no-nas-in-data

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!