我正在尝试根据调查数据 Build 预测模型 . 我的DV是关于NPS和其他类似数据点的问题 . 我的IVs主要是人口统计学问题 . 我使用以下代码行继续获得可变长度错误:
Model <- lm(Q6 ~ amount_spent + first_time + gender +
workshop_participation + adults + children +
household_adults + Below..25K. + X.25K.to..49K. +
X.50K.to..74K. + X.75K.to..99K. + X.100K.to..124K. +
X18.24. + X25.34. + X35.44. + X45.64.,
data = diy_festival2)
Here is the error: Error in model.frame.default(formula = Q6 ~ amount_spent + first_time + : variable lengths differ (found for 'Below..25K.')
有什么可能的原因以及我可以尝试哪些可能的修复方法?
1 回答
您的公式对象引用(a)不在
diy_festival2
中的变量 . 它是在全球环境中,调试表明它是Below..25K.
给出你的错误 .