Learn R Programming

RVAideMemoire (version 0.9-6)

reg.slpcomp: Comparison of simple linear regression slopes

Description

Test for equality of slopes of several simple regression lines. The function returns the confidence interval of each slope and perfoms pairwise comparisons.

Usage

reg.slpcomp(var, covar, fact, conf.level = 0.95, p.method = "fdr")

Arguments

var
numeric vector (response variable).
covar
numeric vector (covariable).
fact
factor (groups).
conf.level
confidence level.
p.method
method for p-values correction. See help of the p.adjust() function.

Value

  • conf.levelconfidence level.
  • coeffsslope of each regression line.
  • coeffs.tabslope and confidence interval of each regression line.
  • p.methodmethod for p-value correction.
  • dfdegrees of freedom of each comparison.
  • ttest statistics.
  • p.valuecorrected p-values.
  • multcompdata.frame of results.

See Also

lm

Examples

Run this code
covariable<-rep(1:30,3)
variable<-c(seq(1,10,9/29)+rnorm(30,0,3),seq(1,30,1)+rnorm(30,0,3),seq(-1,-80,-79/29)+rnorm(30,0,3))
factor<-factor(rep(LETTERS[1:3],each=30))
reg.slpcomp(variable,covariable,factor)

Run the code above in your browser using DataLab