confints {gemR}R Documentation

Confidence Intervals of Effect Differences

Description

Confidence Intervals of Effect Differences

Usage

confints(X1, ...)

## Default S3 method:
confints(X1, X2, confidence = 0.95, df.used = 0, ...)

## S3 method for class 'GEM'
confints(
  X1,
  factor = 1,
  levels = c(1, 2),
  confidence = 0.95,
  df.used = X1$df.used,
  ...
)

## S3 method for class 'confints'
plot(
  x,
  y,
  xlab = "",
  ylab = "values",
  sorted = TRUE,
  labels = FALSE,
  nonZero = FALSE,
  xlim = NULL,
  ylim = NULL,
  text.pt = 12,
  ...
)

Arguments

X1

data.frame containing first effect or GEM object for ER matrix based intervals.

...

Further arguments to qplot.

X2

data.frame containing second effect.

confidence

Level of confidence, default = 0.95.

df.used

Optional argument indicating how many degrees of freedom have been consumed during deflation. Default = 0.

factor

(character or numeric) indicating which factor to use in ER based intervals (defaul = 1).

levels

vector (character or numeric) indicating which factor levels to. use in ER based intervals (default = c(1,2)).

x

Object of class confint.

y

Not used.

xlab

X label (character)

ylab

Y label (character)

sorted

Logical indicating if intervals should be sorted according to their mean values, or a vector of indices/labels to sort by.

labels

Logical indicating if sample labels should be used on x axis.

nonZero

Logical indicating if intervals are required not to include zero.

xlim

Limits of the horizontal scale.

ylim

Limits of the vertical scale.

text.pt

Size scaling of text in the plot (default = 16).

Value

An object of class confints, which holds the information needed to perform statistics or plot the confidence intervals is returned from confints. The plotting routine returns a ggplot structure for plotting.

See Also

Analyses using GEM: elastic, pca, sca, neuralnet, pls.

Examples

data(MS)
# Subset to reduce runtime in example
MS$proteins <- MS$proteins[,20:70]

# Compare MS and non-MS patients within group 1
conf <- with(MS, confints(proteins[MS == "yes" & group == 1,],
                          proteins[MS == "no"  & group == 1,]))
p1 <- plot(conf)
p2 <- plot(conf, nonZero = TRUE) # Only intervals without 0.
grid.arrange(p1,p2)

# Comparison repeated but based on ER matrices
gem <- GEM(proteins ~ MS * group, data = MS)
print(effs <- colnames(gem$symbolicDesign)) # Inspect factor names
confGEM <- confints(gem, factor=effs[3], levels=c("yes.1","no.1"))
p1g <- plot(confGEM)
p2g <- plot(confGEM, nonZero = TRUE) # Only intervals without 0.
grid.arrange(p1g,p2g)

# Shorter plot with labels
confShort <- conf[1:10,]
p1 <- plot(confShort, labels = TRUE)
p2 <- plot(confShort, labels = TRUE, nonZero = TRUE)
grid.arrange(p1,p2)

[Package gemR version 1.2.1 Index]