简体   繁体   English

在 lm 摘要中添加自由度

[英]Adding degrees of freedom in lm summary

i am using this code to run a lot of simple linear regression at the same time, in the output i get the R_squard and p value, however i want also to add the total degrees of freedom to the output, how should i adapt the code so that total degrees of freedom is also added to my output?我正在使用此代码同时运行许多简单的线性回归,在 output 中,我得到 R_squard 和 p 值,但是我还想将总自由度添加到 output,我应该如何调整代码这样总自由度也被添加到我的 output 中?

lm_output = lm(test[,1] ~ test_2[,1])

Output_1 <- data.frame(R_spuared = summary(lm_output)$r.squared)
Output_1$P_value <- summary(lm_output)$coefficients[2,4]
Output_1$Variabele <- paste(colnames(test))
Output_1$Variabele_1 <- paste(colnames(test_2))

thanks in advance提前致谢

summary(lm_output)$fstatistic

The second and third number are the df's for the F-Test.第二个和第三个数字是 F 检验的 df。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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