summary.matrix.glmnet: Sumarize matrix_glmnet fit

Description Usage Arguments Author(s) Examples

Description

This function takes a model fit with matrix_glmnet and calculates a series of statistics depending on the model fit method.

Usage

1
2
3
## S3 method for class 'matrix.glmnet'
summary(object, quantile.probs = c(0.01, 0.025, 0.5,
  0.975, 0.99), funlist = NULL)

Arguments

object

Object from class matrix.glmnet as produced by matrix_glmnet.

quantile.probs

Quantiles to be calculated from bootstrap. Only used if the method element in object is bootstrap.

funlist

A list of function to be tested on the list of coefficients. Each function must take a single numeric vector, and return a single numeric value. Preferentially, the list should be named, otherwise functions will be identified by they numeric indices.

Author(s)

Sur from Dangl lab

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
data(Rhizo)
data(Rhizo.map)
Dat <- create_dataset(Rhizo[1:10,],Rhizo.map)

# Fit model and permute 100 times to estimate null.
# All the code below should also work if method is changed to "bootstrap"
set.seed(743)
m1 <- matrix_glmnet(Dat = Dat, formula = ~ fraction,
                   nperm = 100, family = "poisson",
                   method = "permutation",
                   verbose = FALSE)

# Performs permutation test
m1.sum <- summary(m1)
m1.sum$coefficients

# We can add a function that tests wheather the mean if R and E
# samples is different than the soil
mytestfun <- function(x) {x[2] - mean(x[3],x[4])}

# Following command repeats the permutation test, and tests also
# wheter the value of the new function is significant
m1.sum <- summary(m1,funlist = list(mytest = mytestfun))

# The results are stored in the functions element
m1.sum$functions

surh/AMORglmnet documentation built on May 30, 2019, 8:41 p.m.