Description Usage Arguments Author(s) Examples
This function takes a model fit with matrix_glmnet and calculates a series of statistics depending on the model fit method.
1 2 3 |
object |
Object from class |
quantile.probs |
Quantiles to be calculated from bootstrap. Only used if the method
element in |
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. |
Sur from Dangl lab
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.