Wrap quality statistic of identity relation from data.

# S3 method for data.frame
wrapFTest(
  x,
  predictionColumnName,
  yColumnName,
  nParameters = 1,
  meany = mean(x[[yColumnName]]),
  ...,
  na.rm = FALSE,
  format = NULL
)

Arguments

x

data frame containing columns to compare

predictionColumnName

character name of prediction column

yColumnName

character name of column containing dependent variable

nParameters

number of variables in model

meany

(optional) mean of y

...

extra arguments (not used)

na.rm

logical, if TRUE remove NA values

format

if set the format to return ("html", "latex", "markdown", "ascii", "docx")

Value

formatted string and fields

Examples

d <- data.frame(x=c(1,2,3,4,5,6,7,7), y=c(1,1,2,2,3,3,4,4)) model <- lm(y~x,data=d) summary(model)
#> #> Call: #> lm(formula = y ~ x, data = d) #> #> Residuals: #> Min 1Q Median 3Q Max #> -0.3380 -0.2831 0.1463 0.1855 0.2404 #> #> Coefficients: #> Estimate Std. Error t value Pr(>|t|) #> (Intercept) 0.24390 0.22468 1.086 0.319 #> x 0.51568 0.04622 11.156 3.09e-05 *** #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> #> Residual standard error: 0.2769 on 6 degrees of freedom #> Multiple R-squared: 0.954, Adjusted R-squared: 0.9463 #> F-statistic: 124.5 on 1 and 6 DF, p-value: 3.094e-05 #>
d$pred <- predict(model,newdata=d) sigr::wrapFTest(d,'pred','y')
#> [1] "F Test summary: (R2=0.954, F(1,6)=124.5, p=3.094e-05)."