Learn R Programming

pairwiseCI (version 0.1-21)

pairwiseMEP: Wrapper to compute confidence intervals for multiple endpoints

Description

This is a test version! Computes confidence intervals for pair wise comparisons of groups (assuming independent observations) for multiple endpoints. The methods available in pairwiseCI for continuous and count data can be called. Methods for binary data are currently not available. NOTE: Although multiple endpoints and multiple group wise comparisons are considered, there is no adjustment for multiplicity implemented in this function!

Usage

pairwiseMEP(x, ...)

## S3 method for class 'data.frame':
pairwiseMEP(x, ep, f,
 control = NULL, conf.level = 0.95, 
 alternative = c("two.sided", "less", "greater"), 
 method = "Param.diff", ...)

Arguments

x
a data.frame
ep
a vector of character strings, naming the variables in x which are the response variables (endpoints) of interest
f
a single character string, naming a factor variable in data which splits the dataset into treatment groups
control
optionally, a single character string, naming a factor level in variable f, which shall be considered as control group; if omitted (default) all pairwise comparisons are computed
conf.level
a single numeric between 0.5 and 1, specifying the local confidence level of the single confidence intervals
alternative
a single character string, one of 'two.sided', 'less', 'greater'
method
a vector of character strings, specifying the method for computation of the confidence intervals, see pairwiseCImethodsCont and pairwiseCIm
...
further arguments to be passed to pairwiseCI, options are listed in pairwiseCImethodsCont and

Value

  • conf.inta list with one element for each element in ep, containing the estimates, lower and upper limits and the comparison names and by levels in the format of a data.frame
  • dataas input x
  • epas input
  • fas input
  • controlas input
  • conf.levelas input
  • alternativeas input
  • methodas input

concept

confidence interval

Details

Calls pairwiseCI.

See Also

The result can be plotted: plotCI.pairwiseMEP, and coerced to a data.frame: as.data.frame.pairwiseMEP

Examples

Run this code
x1<-rnorm(120,20,2)
x2<-rnorm(120,100,8)
x3<-rpois(120,10)
x4<-rnbinom(120,mu=10, size=10)
A<-rep(c("a1","a2","a3"), c(40,40,40))
B<-rep(rep(c("b1","b2","b3","b4"), c(10,10,10,10)), times=3)
dat<-data.frame(x1=x1,x2=x2,x3=x3,x4=x4,A=A, B=B)

test<-pairwiseMEP(x=dat, ep=c("x1","x2","x3", "x4"), control="a1",
 f="A", by="B", method=c("Param.ratio","Param.ratio","Negbin.ratio","Negbin.ratio"))
test

plotCI(test, whichep=c("x1","x2"))

plotCI(test, whichep=c("x3","x4"))

Run the code above in your browser using DataLab