【发布时间】:2017-10-26 05:39:48
【问题描述】:
我该如何解决这个错误
>attach(Depression_1)
> logistic<-lm(`any chronic illness in last year?`~`age in years at last birthday`+EDUCAT+`thousands of dollars per year`+`depressed is cesd >= 16`+`regular drinker?`)
> newdata<-data.frame(`age in years at last birthday`=34,EDUCAT=3,`thousands of dollars per year`=20,`depressed is cesd >= 16`=0,`regular drinker?`=1)
> predict(logistic,newdata)
警告信息:
'newdata' had 1 row but variables found have 294 rows
【问题讨论】:
-
这是一个警告,而不是错误
标签: r linear-regression predict