modresults: Creates an object having the main fitting statistics from a...

View source: R/modresults.r

modresultsR Documentation

Creates an object having the main fitting statistics from a regression model.

Description

Function to save the main statistics results froma fitted regression model.

Usage

modresults(mod = mod, print.output = FALSE, conf.lev = 0.95, eng = TRUE)

Arguments

mod

An object containing the fitted model by using the lm() function.

print.output

A logical option for printing, or displaying, the saved outputs at the console. The default is set to TRUE, meanwhile if print.output=FALSE, nothing is printed.

conf.lev

A numeric value (between 0.0001 and 0.9999) representing the confidence level to be used for some components of the output. The default value is 0.95.

eng

The language to be used in the output. English is the default, meanwhile if eng=FALSE, Spanish is used.

Details

The resulting object contains several outputs derived from a regression model.

Value

This function returns a list having several components of a fitted regression model.

Author(s)

A somehow related version of this function was first created by Prof. Timothy Gregoire (Yale University), but the current version is due to Christian Salas-Eljatib.

References

Salas-Eljatib, C. 2021. Análisis de datos con el programa estadístico R: una introducción aplicada. Ediciones Universidad Mayor, Santiago, Chile. 170 p. https://eljatib.com/rlibro

Examples


library(datana)
df <- datana::maple
head(df)
datana::descstat(df[,c("total","dbh")])
graphics::plot(total ~ dbh, data=df)
slr.m1<-stats::lm(total ~ dbh, data=df)
## Example 1 -- store all the results to an object
out<-modresults(mod = slr.m1)
out$modsumm
out$sigma.e
out$press
out$tcal.coef
out$vp.tcal.coef
## Example 2
modresults(mod = slr.m1, print.output=TRUE)

datana documentation built on Aug. 18, 2025, 5:18 p.m.