作者DrRd (就这样吧)
看板R_Language
标题[问题] lack of fit for multiple regression
时间Wed Apr 30 16:38:07 2014
[问题类型]:
程式谘询(我想用R 做某件事情,但是我不知道要怎麽用R 写出来)
[软体熟悉度]:
入门(写过其他程式,只是对语法不熟悉)
[问题叙述]:
用R来执行多元回归的lack of fit test
在网路上找到的方法是单回归用的,多元回归不知道怎麽做
[程式范例]:
reduce.mod = lm(y ~ x)
full.mod = lm(y ~ 0 + as.factor(x))
anova(reduce.mod, full.mod)
但多元回归不能把full.mod写成 lm(y ~ 0 + as.factor(x1) + as.factor(x2))
这样出来的自由度是错的
[关键字]:
lack of fit
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 140.112.62.195
※ 文章网址: http://webptt.com/cn.aspx?n=bbs/R_Language/M.1398847090.A.37B.html