楼主: casperyc
5618 5

为什么这个model是 NA ? [推广有奖]

  • 0关注
  • 0粉丝

硕士生

61%

还不是VIP/贵宾

-

威望
0
论坛币
26 个
通用积分
0
学术水平
0 点
热心指数
1 点
信用等级
0 点
经验
1445 点
帖子
218
精华
0
在线时间
56 小时
注册时间
2009-7-29
最后登录
2019-6-9

楼主
casperyc 发表于 2010-4-7 05:27:54 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
  1. "x1" "x2" "x3" "x4" "x5" "x6" "x7" "x8" "x9" "x10" "x11" "y"
  2. 1 1 -1 1 1 1 -1 -1 -1 1 -1 6.1
  3. 1 -1 1 1 1 -1 -1 -1 1 -1 1 4.7
  4. -1 1 1 1 -1 -1 -1 1 -1 1 1 4.6
  5. 1 1 1 -1 -1 -1 1 -1 1 1 -1 5.9
  6. 1 1 -1 -1 -1 1 -1 1 1 -1 1 7
  7. 1 -1 -1 -1 1 -1 1 1 -1 1 1 5.8
  8. -1 -1 -1 1 -1 1 1 -1 1 1 1 5.7
  9. -1 -1 1 -1 1 1 -1 1 1 1 -1 6.6
  10. -1 1 -1 1 1 -1 1 1 1 -1 -1 5.8
  11. 1 -1 1 1 -1 1 1 1 -1 -1 -1 5.9
  12. -1 1 1 -1 1 1 1 -1 -1 -1 1 5.9
  13. -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 4.8
复制代码
这个是 d.final   (data.frame)

+1 和 -1 是 factor levels
  1. df1=lm(y~
  2.         as.factor(x1)+
  3.         as.factor(x2)+
  4.         as.factor(x3)+
  5.         as.factor(x4)+
  6.         as.factor(x5)+
  7.         as.factor(x6)+
  8.         as.factor(x7)+
  9.         as.factor(x8)+
  10.         as.factor(x9)+
  11.         as.factor(x10)+
  12.         as.factor(x11),
  13.         data=d.final
  14.         )
  15.         
  16. summary(df1)
复制代码
为什么里面有那么多 NA?

  1. Call:
  2. lm(formula = y ~ as.factor(x1) + as.factor(x2) + as.factor(x3) +
  3.     as.factor(x4) + as.factor(x5) + as.factor(x6) + as.factor(x7) +
  4.     as.factor(x8) + as.factor(x9) + as.factor(x10) + as.factor(x11),
  5.     data = d.final)

  6. Residuals:
  7. ALL 12 residuals are 0: no residual degrees of freedom!

  8. Coefficients:
  9.                 Estimate Std. Error t value Pr(>|t|)
  10. (Intercept)       4.8000         NA      NA       NA
  11. as.factor(x1)1    0.3333         NA      NA       NA
  12. as.factor(x2)1    0.3000         NA      NA       NA
  13. as.factor(x3)1   -0.2667         NA      NA       NA
  14. as.factor(x4)1   -0.5333         NA      NA       NA
  15. as.factor(x5)1    0.1667         NA      NA       NA
  16. as.factor(x6)1    0.9333         NA      NA       NA
  17. as.factor(x7)1    0.2000         NA      NA       NA
  18. as.factor(x8)1    0.4333         NA      NA       NA
  19. as.factor(x9)1    0.4333         NA      NA       NA
  20. as.factor(x10)1   0.1000         NA      NA       NA
  21. as.factor(x11)1  -0.2333         NA      NA       NA

  22. Residual standard error: NaN on 0 degrees of freedom
  23. Multiple R-squared:     1,      Adjusted R-squared:   NaN
  24. F-statistic:   NaN on 11 and 0 DF,  p-value: NA
复制代码


我只要一个model 里面有 11个 main effects
该怎么fit?

谢谢!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:model mode del Mod ODE model

沙发
laurence2009 在职认证  发表于 2010-4-7 06:39:25
这是SAS么?看不懂。。呵呵

藤椅
casperyc 发表于 2010-4-7 07:30:16
2# laurence2009

这是 R ...

板凳
snakepointid 发表于 2015-7-2 13:42:02
你这是过度拟合的问题。
Residuals:
ALL 12 residuals are 0: no residual degrees of freedom!
它告诉你,你任何变量去预测y都不存在残差。既然没有残差也就是说你的模型不存在随机性。既然都
没有随机性,哪来的统计量?
按理说你这样的模型根本不会运行。

报纸
横刀立马黄元帅 发表于 2017-4-5 22:14:49
snakepointid 发表于 2015-7-2 13:42
你这是过度拟合的问题。
Residuals:
ALL 12 residuals are 0: no residual degrees of freedom!
那这个问题要怎么解决

地板
pingguoxiao99 发表于 2022-11-4 16:32:31
楼主,这个问题咋解决了????

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-27 00:02