Skip to contents

Coef method for "plmm" class

Usage

# S3 method for class 'plmm'
coef(object, lambda, which = seq_along(object$lambda), drop = TRUE, ...)

Arguments

object

An object of class "plmm."

lambda

A numeric vector of lambda values.

which

Vector of lambda indices for which coefficients to return.

drop

Logical.

...

Additional arguments.

Value

Either a numeric matrix (if model was fit on data stored in memory) or a sparse matrix (if model was fit on data stored filebacked). Rownames are feature names, columns are values of lambda.

Examples

admix_design <- create_design(X = admix$X, y = admix$y)
fit <- plmm(design = admix_design)
coef(fit)[1:10, 41:45]
#>                 0.1860     0.1804     0.1751     0.1698     0.1648
#> (Intercept)  4.7342727  4.7724928  4.8095736  4.8496524  4.8968064
#> Snp1        -0.4078029 -0.4226724 -0.4370988 -0.4513161 -0.4652842
#> Snp2         0.0000000  0.0000000  0.0000000  0.0000000  0.0000000
#> Snp3         0.7811067  0.8518539  0.9204924  0.9866300  1.0494011
#> Snp4         0.0000000  0.0000000  0.0000000  0.0000000  0.0000000
#> Snp5         0.0000000  0.0000000  0.0000000  0.0000000  0.0000000
#> Snp6         0.0000000  0.0000000  0.0000000  0.0000000  0.0000000
#> Snp7         0.0000000  0.0000000  0.0000000  0.0000000  0.0000000
#> Snp8         0.0000000  0.0000000  0.0000000  0.0000000  0.0000000
#> Snp9         0.0000000  0.0000000  0.0000000  0.0000000  0.0000000