Learn R Programming

RVAideMemoire (version 0.9-6)

reg.intcomp: Common slope and comparison of simple linear regression intercepts

Description

Compute the common slope of parallel linear regression lines and test for equality of intercepts. The function returns the common slope and its confidence interval, the intercept of each regression line and its confidence interval, test for equality of each intercept to a given value and performs pairwise comparisons between intercepts.

Usage

reg.intcomp(var, covar, fact, conf.level = 0.95, theo = rep(0, nlevels(fact)), p.method = "fdr")

Arguments

var
numeric vector (response variable).
covar
numeric vector (covariable).
fact
factor (groups).
conf.level
confidence level.
theo
numeric vector: theoretical value of each intercept.
p.method
method for p-values correction. See healp of the p.adjust() function.

Value

  • conf.levelconfidence level.
  • slope.commcommon slope and confidence interval.
  • interceptsintercept of each regression line.
  • intercepts.ciconfidence interval of intercepts.
  • intercepts.theotheoretical intercepts.
  • intercepts.ttest statistics for equality to theoretical values.
  • intercepts.pcorrected p-values for equality to theoretical values.
  • intercepts.tabdata.frame of results of tests for equality to theoretical value.
  • p.methodmethod for p-values correction.
  • df.multcompdegrees of freedom of pairwise comparisons.
  • t.multcomptest statistics of pairwise comparisons.
  • p.multcompcorrected p-values of pairwise comparisons.
  • multcompdata.frame of results of pairwise comparisons.

See Also

lm

Examples

Run this code
covariable<-rep(1:30,3)
variable<-c(1:30+rnorm(30,0,3),seq(10,35,25/29)+rnorm(30,0,3),seq(-27,0,27/29)+rnorm(30,0,3))
factor<-as.factor(rep(LETTERS[1:3],each=30))
reg.intcomp(variable,covariable,factor)

Run the code above in your browser using DataLab