stat_extract: Extract Summary Statistics from Model Fit Object

View source: R/stat_extract.R

stat_extractR Documentation

Extract Summary Statistics from Model Fit Object

Description

Accepts model fit object and extracts core statistical information. This includes P value, test statistic, degrees of freedom, etc. Currently accepts the following model types: 'stats::t.test', 'stats::lm', 'stats_nls', 'nlme::lme', 'lmerTest::lmer', 'ecodist::MRM', or 'RRPP::trajectory.analysis'

Usage

stat_extract(mod_fit = NULL, traj_angle = "deg")

Arguments

mod_fit

(lme, trajectory.analysis) Model fit object of supported class (see function description text)

traj_angle

(character) Either "deg" or "rad" for whether trajectory analysis angle information should be extracted in degrees or radians. Only required if model is trajectory analysis

Value

(data.frame) Dataframe of core summary statistics for the given model

Examples

# Create some example data
x <- c(3.5, 2.1, 7.5, 5.6, 3.3, 6.0, 5.6)
y <- c(2.3, 4.7, 7.8, 9.1, 4.5, 3.6, 5.1)

# Fit a linear model
mod <- lm(y ~ x)

# Extract the relevant information
stat_extract(mod_fit = mod)


scicomptools documentation built on Nov. 1, 2024, 1:06 a.m.