Format the coefficients from a linear model as a tibble
Format the coefficients from a linear model as a tibble
tbl_coef(mod,...)
Arguments
mod: An lm model object
...: currently ignored
Returns
A tibble::tbl_df object containing the fitted coefficients.
Examples
# Convert a time series into a data frame with indicesds <- data.frame(y = as.ts(CET), t =1:length(CET))# Retrieve the coefficients from a null modeltbl_coef(lm(y ~1, data = ds))# Retrieve the coefficients from a two changepoint modeltbl_coef(lm(y ~(t >=42)+(t >=81), data = ds))# Retrieve the coefficients from a trendshift modeltbl_coef(lm(y ~ poly(t,1, raw =TRUE)*(t >=42)+ poly(t,1, raw =TRUE)*(t >=81), data = ds))# Retrieve the coefficients from a quadratic modeltbl_coef(lm(y ~ poly(t,2, raw =TRUE)*(t >=42)+ poly(t,2, raw =TRUE)*(t >=81), data = ds))