Learn R Programming

lmdme (version 1.14.0)

p.adjust: p.adjust of p-values for Multiple Test Comparison Corrections

Description

Given a set of p-values, returns adjusted p-values using one of several methods.

Usage

"p.adjust"(p, term=NULL, method=p.adjust.methods, drop=TRUE)

Arguments

p
numeric vector of p-values as in stats::p.adjust or lmdme class object.
method
correction method available in p.adjust.methods.
term
character with the corresponding term to return.
...
other arguments.
drop
should try to drop the list structure if length==1? Default value is TRUE

Value

according to the call, one of the following objects can be returned
numeric
vector of adjusted p-values.
matrix
for lmdme object If term!=NULL, the corresponding character is looked up within the list of p.values returning the associated matrix of G rows (individuals) x k columns (levels of the corresponding model term) with the adjusted p-values.

See Also

p.adjust, p.adjust.methods

Examples

Run this code
{
data(stemHypoxia)

##Just to make a balanced dataset in the Fisher sense (2 samples per
## time*oxygen levels)
design<-design[design$time %in% c(0.5, 1, 5) & design$oxygen %in% c(1,5,21),]
design$time<-as.factor(design$time)
design$oxygen<-as.factor(design$oxygen)
rownames(M)<-M[, 1]

##Keeping appropriate samples only
M<-M[, colnames(M) %in% design$samplename]

##ANOVA decomposition
fit<-lmdme(model=~time+oxygen+time:oxygen, data=M, design=design)

##Adjust p-values only on the interaction p.values using false discovery rate
## method
pInteraction<-p.values(fit, term="time:oxygen")
FDRInteraction<-p.adjust(fit, term="time:oxygen", method="fdr")
corrected<-sum(pInteraction < 0.05) - sum(FDRInteraction < 0.05)
}

Run the code above in your browser using DataLab