Skip to contents

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

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

Details

These functions are called in the cp and cn calls.

See also

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)
#>            Length Class  Mode   
#> theta       8     -none- numeric
#> coef        8     -none- numeric
#> vcov_theta 64     -none- numeric
#> vcov       64     -none- numeric