View source: R/padjustCompareGroups.R
padjustCompareGroups | R Documentation |
Given a compareGroups object, returns their p-values adjusted using one of several methods (stats::p.adjust)
padjustCompareGroups(object_compare, p = "p.overall", method = "BH")
object_compare |
object of class |
p |
character string. Specify which p-value must be corrected. Possible values are 'p.overall' and 'p.trend' (default: 'p.overall') |
method |
Correction method, a character string. Can be abbreviated (see |
compareGroups class with corrected p-values
Jordi Real <jordireal<at>gmail.com>
# Define simulated data
set.seed(123)
N_obs<-100
N_vars<-50
data<-matrix(rnorm(N_obs*N_vars), N_obs, N_vars)
sim_data<-data.frame(data,Y=rbinom(N_obs,1,0.5))
# Execute compareGroups
res<-compareGroups(Y~.,data=sim_data)
res
# update p values
res_adjusted<-padjustCompareGroups(res)
res_adjusted
# update p values using FDR method
res_adjusted<-padjustCompareGroups(res, method ="fdr")
res_adjusted
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.