padjustCompareGroups: Update p values according multiple comparisons

View source: R/padjustCompareGroups.R

padjustCompareGroupsR Documentation

Update p values according multiple comparisons

Description

Given a compareGroups object, returns their p-values adjusted using one of several methods (stats::p.adjust)

Usage

padjustCompareGroups(object_compare, p = "p.overall", method = "BH")

Arguments

object_compare

object of class compareGroups

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 p.adjust).

Value

compareGroups class with corrected p-values

Author(s)

Jordi Real <jordireal<at>gmail.com>

Examples

# 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


compareGroups documentation built on Nov. 18, 2022, 5:11 p.m.