Learn R Programming

SPQR (version 0.1.0)

coef.SPQR: coef method for class SPQR

Description

Computes the estimated spline coefficients of a SPQR class object

Usage

# S3 method for SPQR
coef(object, X, ...)

Arguments

object

An object of class SPQR.

X

The covariate vector/matrix for which the coefficient is calculated.

...

Other arguments.

Value

A NROW(X) by K matrix containing values of the estimated coefficient, where K is the number of basis functions.

Examples

Run this code
# NOT RUN {
set.seed(919)
n <- 200
X <- rbinom(n, 1, 0.5)
Y <- rnorm(n, X, 0.8)
control <- list(iter = 200, warmup = 150, thin = 1)
fit <- SPQR(X = X, Y = Y, method = "MCMC", control = control,
            normalize = TRUE, verbose = FALSE)
coef(fit, X = 0)
# }

Run the code above in your browser using DataLab