简体   繁体   中英

How can you extract T-values from a multiple regression to put them in a vector in R?

When running a multiple regression, as shown here (data is from the 2014 and 2015 NHL seasons and is being used to predict wins):

TwoPredictorModel<-lm(Wins~Time.Shorthanded+Shots.per.Game, data=dat)
summary(TwoPredictorModel)

And yields the following outcome:

Coefficients:
                   Estimate Std. Error t value Pr(>|t|)
(Intercept)      -18.042277  18.056039  -0.999 0.321903
Time.Shorthanded   0.009883   0.035455   0.279 0.781450
Shots.per.Game     1.889582   0.469588   4.024 0.000171

How can I extract the T-values in R to put them into a vector?

将其拉出摘要,例如

summary(lm(mpg~wt+hp, mtcars))$coefficients[,"t value"]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM