beta.mm: Compute the least-squares slope estimate for simple linear...

Description Usage Arguments Value Examples

Description

Given two numeric vectors, computes a least-squares slope estimate for the model y = a + b*x + disturbance. lm() also returns this number, but beta.mm() is faster, which is advantageous for simulating bootstrapping or permutation testing.

Usage

1
beta.mm(x, y)

Arguments

x

A numeric vector containing entries for the independent variable.

y

A numeric vector containing entries for the dependent variable, must be the same length as x.

Value

The least-squares slope estimate (i.e. the estimate of b) for the model y = a + b*x + disturbance.

Examples

1
beta.mm(rnorm(10), rnorm(10))

mdedge/stfspack documentation built on May 9, 2019, 8:17 a.m.