get_coefs: Get coefficients for the parametric terms (intercepts and...

View source: R/predict.R

get_coefsR Documentation

Get coefficients for the parametric terms (intercepts and random slopes).

Description

Wrapper around the function coef, and loosely based on summary.gam. This function provides a much faster alternative for summary(model)$p.table. The function summary.gam) may take considerably more time for large models, because it additionally needs to calculate estimates for the smooth term table.

Usage

get_coefs(model, se = TRUE)

Arguments

model

A gam object, produced by gam or bam.

se

Logical: whether or not to return the standard errors.

Value

The coefficients of the parametric terms.

Author(s)

Jacolien van Rij

See Also

Other Model predictions: get_difference(), get_fitted(), get_modelterm(), get_predictions(), get_random()

Examples

data(simdat)

# Condition as factor, to have a random intercept
# for illustration purposes:
simdat$Condition <- as.factor(simdat$Condition)

# Model with random effect and interactions:
m1 <- bam(Y ~ Group * Condition + s(Time),
    data=simdat)

# extract all parametric coefficients:
get_coefs(m1)
# calculate t-values:
test <- get_coefs(m1)
test <- cbind(test, test[,1] / test[,2] )
colnames(test)[3] <- 't-value'
test

# get_coefs returns the same numbers as shown in the parametric summary:
summary(m1)
# get_coefs is based on the function coef. This function returns 
# values of all coefficients, and does not provide SE:
coef(m1)


itsadug documentation built on June 17, 2022, 5:05 p.m.