Skip to contents

Coef method for "plmm" class

Usage

# S3 method for class 'plmm'
coef(object, lambda, which = 1:length(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.02673     0.02493     0.02325     0.02168     0.02022
#> (Intercept)  6.556445885  6.59257224  6.62815211  6.66317769  6.69366816
#> Snp1        -0.768261488 -0.78098090 -0.79310257 -0.80456803 -0.81482505
#> Snp2         0.131945426  0.13991539  0.14735024  0.15387884  0.15929074
#> Snp3         2.826806831  2.83842545  2.84879468  2.85860151  2.86047026
#> Snp4         0.036981534  0.04652885  0.05543821  0.06376126  0.07133592
#> Snp5         0.546784811  0.57461391  0.60049082  0.62402782  0.64291324
#> Snp6        -0.026215632 -0.03072017 -0.03494534 -0.03889146 -0.04256362
#> Snp7         0.009342269  0.01539705  0.02103262  0.02615358  0.03069956
#> Snp8         0.000000000  0.00000000  0.00000000  0.00000000  0.00000000
#> Snp9         0.160794660  0.16217570  0.16337102  0.16464901  0.16638663