Learn R Programming

RVAideMemoire (version 0.9-11)

least.rect: Least rectangles linear regression

Description

Return information about a least rectangle linear regression: equation, confidence interval of parameters, equality of the slope to a given value and Pearson's linear correlation coefficient.

Usage

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

Arguments

formula
a formula of the form y ~ x, where y and x give the y and x variable, respectively.
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.

Value

  • coefficientsregression parameters.
  • xname of the x variable.
  • yname of the y variable.
  • residualsresiduals.
  • fitted.valuesfitted values.
  • conf.levelconfidence level.
  • conf.intconfidence interval of regression parameters.
  • slope.theotheoretical value of the slope.
  • df.compdegrees of freedom for equality of the slope to the theoretical value.
  • statistic.comptest statitics for equality of the slope to the theoretical value.
  • p.value.compp-value for equality of the slope to the theoretical value.
  • modelvalues of x and y variables.
  • compdata frame of results for equality of the slope to the theoretical value.
  • rPearson's linear correlation coefficient and confidence interval.
  • r.dfdegrees of freedom for significativity of the correlation coefficient.
  • r.statistictest statistics for significativity of the correlation coefficient.
  • r.p.valuep-value for significativity of the correlation coefficient.
  • corrdata frame of results for significativity of the correlation coefficient.

See Also

cor.test

Examples

Run this code
x <- 1:30+rnorm(30,0,3)
y <- 1:30+rnorm(30,0,3)
least.rect(y~x)

Run the code above in your browser using DataLab