statistics - How to calculate P values in ridge regression in R? -
following example ?lm.ridge of mass package:
> data(longley) # not same s-plus dataset > names(longley)[1] <- "y" > lm.ridge(y ~ ., longley) gnp unemployed armed.forces population year employed 2946.85636017 0.26352725 0.03648291 0.01116105 -1.73702984 -1.41879853 0.23128785 > plot(lm.ridge(y ~ ., longley, + lambda = seq(0,0.1,0.001))) > select(lm.ridge(y ~ ., longley, + lambda = seq(0,0.1,0.0001))) modified hkb estimator 0.006836982 modified l-w estimator 0.05267247 smallest value of gcv @ 0.0057
how can calculate p values or confidence intervals can in usual linear regression summary.
as far concerned mass::lm.ridge
not calculate p-values coefficients. use linearridge
function ridge
package, however, does. see following example:
data(longley) names(longley)[1] <- "y" library(ridge) 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
and using summary
familiar looking table p-values , significance!
Comments
Post a Comment