coef.kspm: Extract Model Coefficients

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/coefKspm.R

Description

Returns linear and kernel coefficients for a model of class "kspm".

Usage

1
2
## S3 method for class 'kspm'
coef(object, ...)

Arguments

object

an object of class "kspm", usually, a result of a call to kspm.

...

additional optional argument (currently unused).

Value

Two matrices of coefficients.

linear

A vector of coefficients for linear part. One row is one variable.

kernel

A matrix of coefficients for linear part. One row is one subject, one column is one kernel part.

Author(s)

Catherine Schramm, Aurelie Labbe, Celia Greenwood

References

Liu, D., Lin, X., and Ghosh, D. (2007). Semiparametric regression of multidimensional genetic pathway data: least squares kernel machines and linear mixed models. Biometrics, 63(4), 1079:1088.

See Also

kspm for fitting model.

Examples

1
2
3
4
5
6
7
x <- 1:15
z1 <- runif(15, 1, 6)
z2 <- rnorm(15, 1, 2)
y <- 3*x + (z1 + z2)^2 + rnorm(15, 0, 2)
fit <- kspm(y, linear = ~ x, kernel = ~ Kernel(~ z1 + z2,
kernel.function = "polynomial", d= 2, rho = 1, gamma = 0))
coef(fit)

KSPM documentation built on Aug. 10, 2020, 5:07 p.m.