ridge包使用岭回归--自动选择lamda值

library(ridge)
data(longley) 
names(longley)[1] <- "y"


mymod <- linearRidge(y ~ ., longley)


summary(mymod)


Call:
linearRidge(formula = y ~ ., data = longley)




Coefficients:
               Estimate Scaled estimate Std. Error (scaled) t value (scaled) Pr(>|t|)    
(Intercept)  -1.247e+03              NA                  NA               NA       NA    
GNP           4.338e-02       1.670e+01           3.689e+00            4.526  6.0e-06 ***
Unemployed    1.184e-02       4.286e+00           2.507e+00            1.710   0.0873 .  
Armed.Forces  1.381e-02       3.721e+00           1.905e+00            1.953   0.0508 .  
Population   -2.831e-02      -7.627e-01           5.285e+00            0.144   0.8853    
Year          6.566e-01       1.211e+01           2.691e+00            4.500  6.8e-06 ***
Employed      6.745e-01       9.175e+00           4.996e+00            1.836   0.0663 .  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1


Ridge parameter: 0.01046912, chosen automatically, computed using 2 PCs


Degrees of freedom: model 3.67 , variance 3.218 , residual 4.123 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值