Learn R Programming

pairwiseCI (version 0.1-21)

as.data.frame.pairwiseMEP: Coerce pairwiseMEP objects to data.frames

Description

Coerces the output of the function pairwiseMEP to a data.frame.

Usage

## S3 method for class 'pairwiseMEP':
as.data.frame(x, row.names = NULL,
 optional = FALSE, whichep = NULL, ...)

Arguments

x
an object of class pairwiseMEP as can be obtained by calling pairwiseMEP
row.names
as in as.data.frame
optional
as in as.data.frame
whichep
a vector of integers or character strings, indexing which endpoints (which response variables) from object x shall be coerced to a data.frame; if omitted (default), all endpoints are coerced to a data.frame
...
Further arguments to be passed to as.data.frame

Value

  • A data.frame with columns
  • estimatenumeric, the point estimates
  • lowernumeric, the lower confidence limits
  • uppernumeric, the upper confidence limits
  • comparisoncharacter, the name of the groupwise comparison
  • byoptional, character, the name of subset of the original data.frame
  • responsecharacter, the name of the response variable
  • methodcharacter, the name of the method used for calculation of the lower and upper limits, see 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"),
 f="A", by="B",
 method=c("Param.ratio","Param.ratio","Negbin.ratio","Negbin.ratio"))

test

as.data.frame(test)


as.data.frame(test, whichep=c(1,2))

as.data.frame(test, whichep=c(3,4))

as.data.frame(test, whichep=c("x1","x2"))

Run the code above in your browser using DataLab