Skip to contents

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)
#>          Term  Estimate Std_Error   T_Value   P_Value
#> 1 (Intercept) 2.0661017 2.4263807 0.8515159 0.4333616
#> 2           x 0.6737288 0.4751741 1.4178568 0.2154314