全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
2103 0
2017-11-19
用lmp()函数对简单线性回归做置换检验,并且与基于正态性理论的lm()的模型比较,发现置换检验输出的参数估计值没有常数项(标红色是两个模型参数估计位置),为什么呢?
数据来自于women数据集
>fit1<-lmp(weight~height,data=women,perm="Prob")#简单回归置换检验
>summary(fit1)

[1] "Settings:  unique SS : numeric variables centered"

Call:
lmp(formula = weight ~ height, data = women, perm = "Prob")
Residuals:
    Min      1Q  Median      3Q     Max
-1.7333 -1.1333 -0.3833  0.7417  3.1167
Coefficients:
             Estimate Iter Pr(Prob)   
height     3.45 5000   <2e-16 ***

---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.525 on 13 degrees of freedom
Multiple R-Squared: 0.991,      Adjusted R-squared: 0.9903
F-statistic:  1433 on 1 and 13 DF,  p-value: 1.091e-14

>fit<-lm(weight~height,data=women)#基于正态性理论的简单回归
>summary(fit)#展示拟合模型的详细结果
Call:
lm(formula = weight ~ height, data = women)
Residuals:
    Min      1Q  Median      3Q     Max
-1.7333 -1.1333 -0.3833  0.7417  3.1167
Coefficients:
               Estimate Std. Error t value Pr(>|t|)   
(Intercept) -87.51667    5.93694  -14.74 1.71e-09 ***
height        3.45000    0.09114   37.85 1.09e-14 ***

---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.525 on 13 degrees of freedom
Multiple R-squared:  0.991,     Adjusted R-squared:  0.9903
F-statistic:  1433 on 1 and 13 DF,  p-value: 1.091e-14

阿里嘎多~

二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群