Wrap quality statistic of a linear relation from anova.

# S3 method for anova
wrapFTest(x, ...)

Arguments

x

result from stats::anova(stats::lm())

...

extra arguments (not used)

Value

list of formatted string and fields

Examples

d <- data.frame(x1 = c(1,2,3,4,5,6,7,7), x2 = c(1,0,3,0,5,6,0,7), y = c(1,1,2,2,3,3,4,4)) model <- lm(y~x1+x2, data=d) summary(model)
#> #> Call: #> lm(formula = y ~ x1 + x2, data = d) #> #> Residuals: #> 1 2 3 4 5 6 7 8 #> 0.2321 -0.2550 0.1891 -0.2636 0.1461 -0.3754 0.2235 0.1032 #> #> Coefficients: #> Estimate Std. Error t value Pr(>|t|) #> (Intercept) 0.24642 0.24273 1.015 0.356584 #> x1 0.50430 0.05820 8.665 0.000338 *** #> x2 0.01719 0.04519 0.380 0.719246 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> Residual standard error: 0.299 on 5 degrees of freedom #> Multiple R-squared: 0.9553, Adjusted R-squared: 0.9374 #> F-statistic: 53.43 on 2 and 5 DF, p-value: 0.0004224 #>
sigr::wrapFTest(model)
#> [1] "F Test summary: (R2=0.9553, F(2,5)=53.43, p=0.0004224)."
anov <- stats::anova(model) print(anov)
#> Analysis of Variance Table #> #> Response: y #> Df Sum Sq Mean Sq F value Pr(>F) #> x1 1 9.5401 9.5401 106.7142 0.0001463 *** #> x2 1 0.0129 0.0129 0.1447 0.7192462 #> Residuals 5 0.4470 0.0894 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
lapply(sigr::wrapFTest(anov), function(ti) { sigr::render(ti, pLargeCutoff= 1, pSmallCutoff= 0, statDigits=4, sigDigits=4, format='ascii') })
#> $x1 #> [1] "F Test summary: (R2=0.9552, F(1,5)=106.7, p=0.0001463)." #> #> $x2 #> [1] "F Test summary: (R2=0.02813, F(1,5)=0.1447, p=0.7192)." #>