Learn R Programming

WRS2 (version 0.2-0)

ancova: Robust ANCOVA for 2 independent groups and one covariate.

Description

This function computes robust ANCOVA for 2 independent groups and one covariate. It compares trimmed means. No parametric assumption (e.g. homogeneity) is made about the form of the regression lines. A running interval smoother is used. A bootstrap version which computes confidence intervals using a percentile t-bootstrap is provided as well.

Usage

ancova(formula, data, tr = 0.2, sm = FALSE, fr1 = 1, fr2 = 1, pr = TRUE, pts = NA)

ancboot(formula, data, tr = 0.2, nboot = 599, sm = FALSE, fr1 = 1, fr2 = 1, pr = TRUE, pts = NA)

Arguments

formula
an object of class formula.
data
an optional data frame for the input data.
tr
trim level for the mean.
sm
if TRUE it create smooths using bootstrap bagging.
fr1
values of the span for the first group (1 means unspecified)
fr2
values of the span for the second group (1 means unspecified)
pr
if TRUE confidence intervals are adjusted to control the probability of at least one Type I error (but p-values are not)
pts
can be used to specify the design points where the regression lines are to be compared; if NA design points are chosen.
nboot
number of bootstrap samples

Value

  • Returns an object of class ancova containing:
  • evalptscovariate values (including points close to these values) where the test statistic is evaluated
  • n1number of subjects at evaluation point (first group)
  • n2number of subjects at evaluation point (first group)
  • trDifftrimmed mean differences
  • sestandard errors for trimmed mean differences
  • ci.lowlower confidence limit for trimmed mean differences
  • ci.hiupper confidence limit for trimmed mean differences
  • testvalues of the test statistic
  • crit.valscritical values
  • p.valsp-values
  • callfunction call

References

Wilcox, R. (2012). Introduction to Robust Estimation and Hypothesis Testing (3rd ed.). Elsevier.

See Also

t2way

Examples

Run this code
head(invisibility)
ancova(mischief2 ~ cloak + mischief1, data = invisibility)

## specifying covariate evaluation points
ancova(formula = mischief2 ~ cloak + mischief1, data = invisibility, pts = c(3, 4, 8, 1))

## bootstrap version
ancboot(mischief2 ~ cloak + mischief1, data = invisibility)

Run the code above in your browser using DataLab