least.rect: Least rectangles linear regression

View source: R/least.rect.R

least.rectR Documentation

Least rectangles linear regression

Description

Fits a least rectangle linear regression, possibly for each level of a factor.

Usage

least.rect(formula, data, conf.level = 0.95, theo = 1, adj = TRUE)

Arguments

formula

a formula of the form y ~ x, where y and x give the y and x variable, respectively. The formula can also be y ~ x | f to fit a (separate) regression for each level of the factor f.

data

an optional data frame containing the variables in the formula formula. By default the variables are taken from environment(formula).

conf.level

confidence level.

theo

theoretical value of the slope. If several regression are fitted, the same value is used for all comparisons of slope vs. theoretical value.

adj

logical indicating if, in case of several regressions fitted, confidence intervals and p-values should be Bonferroni-corrected for multiple testing.

Value

coefficients

regression parameters.

residuals

residuals.

fitted.values

fitted values.

call

the matched call.

model

the model frame used.

conf.level

confidence level.

conf.int

confidence interval of regression parameters.

theo

theoretical value of the slope.

comp

data frame of results for equality of the slope(s) to the theoretical value.

corr

data frame of results for significativity of the correlation coefficient(s).

multiple

logical, TRUE if several regressions are fitted.

adj

logical, TRUE if confidence intervals and p-values are corrected for multiple testing (only if several regressions are fitted).

Author(s)

Maxime HERVE <maxime.herve@univ-rennes1.fr>

Examples

x <- 1:30+rnorm(30,0,3)
y <- 1:30+rnorm(30,0,3)
regression1 <- least.rect(y~x)
summary(regression1)

x2 <- c(1:30,1:30)
y2 <- c(1:30+rnorm(30,0,3),seq(10,22,12/29)+rnorm(30,0,3))
fact <- gl(2,30,labels=LETTERS[1:2])
regression2 <- least.rect(y2~x2|fact)
summary(regression2)

RVAideMemoire documentation built on Nov. 6, 2023, 5:07 p.m.