I would like to know if I could have only specific components of the R Summary output to be displayed. From the output below, I would like only the F-statistic (or only the following line-F-statistic: 0.834 on 2 and 10 DF, p-value: 0.4624) to be displayed. I am actually dealing with an imputed data and trying to extract this value from a series of summary outputs.
Thank you!
> hanes=with(nhanes, lm(bmi~hyp+chl))
> summary(hanes)
Call:
lm(formula = bmi ~ hyp + chl)
Residuals:
Min 1Q Median 3Q Max
-6.425 -3.296 0.035 3.123 7.632
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 20.10564 5.70716 3.523 0.00551 **
hyp -0.68459 3.39596 -0.202 0.84428
chl 0.03783 0.03054 1.239 0.24370
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 4.66 on 10 degrees of freedom
(12 observations deleted due to missingness)
Multiple R-squared: 0.143, Adjusted R-squared: -0.02846
F-statistic: 0.834 on 2 and 10 DF, p-value: 0.4624
UPDATE WITH REPRODUCIBLE EXAMPLE WITH NHANES2 DATA IN R:
> imp10=mice(nhanes2, m=10, seed=11111)
> hanes=with(imp10, lm(bmi~hyp+chl))
> summary(hanes)
above yields summary for each of the 10 imputations:
## summary of imputation 1 :
Call:
lm(formula = bmi ~ hyp + chl)
Residuals:
Min 1Q Median 3Q Max
-7.4597 -3.1938 0.1403 2.8153 7.0753
Coefficients:
Estimate Std. Error t value Pr(>|t|)
Intercept) 19.30988 4.47439 4.316 0.000279 ***
hyp2 -0.38202 2.41568 -0.158 0.875789
chl 0.04265 0.02398 1.779 0.089101 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 4.332 on 22 degrees of freedom
Multiple R-squared: 0.1425, Adjusted R-squared: 0.06456
F-statistic: 1.828 on 2 and 22 DF, p-value: 0.1843
The fs=summary(hanes)$fstatistic code still produces complete summary. Thank you again!