coef_vcov {cpr}R Documentation

Extract Regression Coefficients for B-Splines and Tensor Products of B-splines

Description

An S3 method for extracting the regression coefficients of the bsplines and btensor terms. By Default this uses stats::coef to extract all the regression coefficients. A specific method for lmerMod objects has been provided. If you are using a regression method which stats::coef will not return the regression coefficients, you'll need to define an S3 method for stats::coef to do so.

Usage

coef_vcov(fit, theta_idx)

Arguments

fit

a regression model fit

theta_idx

numeric index for the theta related coefficients

Details

These functions are called in the cp and cn calls.

Value

A list with four elements

theta

theta regression coefficients

coef

all regression coefficients

vcov_theta

subsection of variance-covariance matrix pertaining to the theta values

vcov

full variance-covariance matrix

See Also

coef cp cn

Examples


cp0 <- cp(log10(pdg) ~ bsplines(day, df = 6, bknots = c(-1, 1)) + age + ttm, data = spdg)
cv <- cpr:::coef_vcov(cp0$fit)

summary(cv)


[Package cpr version 0.4.0 Index]