Skip to contents

The function returns a vector of p-values for association between potential mediators and exposure/outcome variables adjusted for latent factors computed by lfmm2. As input, it takes an object of class lfmm2Class with the data that were used to adjust the LFMM. If full is set to FALSE, the function computes significance values (p-values) for each exposure variable, otherwise it returns p-values for the full set of exposure variables.

Usage

lfmm2_med_test(
  object,
  input,
  env,
  covar,
  full = FALSE,
  genomic.control = TRUE,
  linear = TRUE,
  family = binomial(link = "logit")
)

Arguments

object

lfmm2Class object

input

a response variable matrix with n rows and p columns

env

An explanatory variable matrix with n rows and d columns.

covar

covariables

full

compute partial regression FALSE/TRUE

genomic.control

correct pvalue with genomic inflation factor

linear

true or false (else is logistic)

family

of logistic reg

Value

an object with the following attributes P-values, fscores, zscores, adj.squared, gif

Author

Florence Pittion, Magali Richard, Olivier Francois

Examples

attach(simu_data)
#> The following objects are masked from simu_data (pos = 3):
#> 
#>     M, M1, M2, X_binary, X_categorial, X_continuous, X_continuous_2,
#>     Y_binary, Y_continuous, age, gender
K = 5
mod.lfmm1 = lfmm2_med(input = simu_data$M1, 
env = simu_data$X_binary, 
K = K,
effect.sizes = FALSE)

res_reg1 = lfmm2_med_test(mod.lfmm1, 
input = simu_data$M1, 
env = simu_data$X_binary,
covar = cbind(simu_data$age, simu_data$gender),
genomic.control = TRUE)