Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

contest1D.lmerModLmerTest

Contrast Tests in 1D


Description

Compute the test of a one-dimensional (vector) contrast in a linear mixed model fitted with lmer from package lmerTest. The contrast should specify a linear function of the mean-value parameters, beta. The Satterthwaite or Kenward-Roger method is used to compute the (denominator) df for the t-test.

Usage

## S3 method for class 'lmerModLmerTest'
contest1D(
  model,
  L,
  rhs = 0,
  ddf = c("Satterthwaite", "Kenward-Roger"),
  confint = FALSE,
  level = 0.95,
  ...
)

## S3 method for class 'lmerMod'
contest1D(
  model,
  L,
  rhs = 0,
  ddf = c("Satterthwaite", "Kenward-Roger"),
  confint = FALSE,
  level = 0.95,
  ...
)

Arguments

model

a model object fitted with lmer from package lmerTest, i.e., an object of class lmerModLmerTest.

L

a numeric (contrast) vector of the same length as fixef(model).

rhs

right-hand-side of the statistical test, i.e. the hypothesized value (a numeric scalar).

ddf

the method for computing the denominator degrees of freedom. ddf="Kenward-Roger" uses Kenward-Roger's method.

confint

include columns for lower and upper confidence limits?

level

confidence level.

...

currently not used.

Details

The t-value and associated p-value is for the hypothesis L' β = rhs in which rhs may be non-zero and β is fixef(model). The estimated value ("Estimate") is L' β with associated standard error and (optionally) confidence interval.

Value

A data.frame with one row and columns with "Estimate", "Std. Error", "t value", "df", and "Pr(>|t|)" (p-value). If confint = TRUE "lower" and "upper" columns are included before the p-value column.

Author(s)

Rune Haubo B. Christensen

See Also

contest for a flexible and general interface to tests of contrasts among fixed-effect parameters. contestMD is also available as a direct interface for tests of multi degree-of-freedom contrast.

Examples

# Fit model using lmer with data from the lme4-package:
data("sleepstudy", package="lme4")
fm <- lmer(Reaction ~ Days + (1 + Days|Subject), sleepstudy)

# Tests and CI of model coefficients are obtained with:
contest1D(fm, c(1, 0), confint=TRUE) # Test for Intercept
contest1D(fm, c(0, 1), confint=TRUE) # Test for Days

# Tests of coefficients are also part of:
summary(fm)

# Illustrate use of rhs argument:
contest1D(fm, c(0, 1), confint=TRUE, rhs=10) # Test for Days-coef == 10

lmerTest

Tests in Linear Mixed Effects Models

v3.1-3
GPL (>= 2)
Authors
Alexandra Kuznetsova [aut], Per Bruun Brockhoff [aut, ths], Rune Haubo Bojesen Christensen [aut, cre], Sofie Pødenphant Jensen [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.