ho.coef {NCStats}R Documentation

Performs a hypothesis test that a parameter in a linear model is equal to some specific value.

Description

Performs a hypothesis test that a parameter in a linear model is equal to some specific value. Useful for testing that a parameter is equal to some value other than 0.

Usage

ho.coef(lmobj,term=2,bo=0,alt=c("two.sided","less","greater"))

Arguments

lmobj A lm object.
term A number indicating which term in the model to use in the hypothesis test.
bo The null hypothesized parameter value.
alt A string identifying the "direction" of the alternative hypothesis. See details.

Details

The “direction” of the alternative hypothesis is identified by a string in the alt argument. The strings may be "less" for a “less than” alternative, "greater" for a “greater than” alternative, or "two.sided" for a “not equals” alternative (the DEFAULT).

If the lm object is from a simple linear regression with an intercept then term=1 will use the intercept and term=2 will use the slope in the hypothesis test.

Value

Returns a matrix containing the term number, hypothesized value, parameter estimate, standard error of the parameter estimate, t test statistic, and corresponding p-value.

Author(s)

Derek H. Ogle, dogle@northland.edu

See Also

ho.bc.

Examples

data(Mirex)
attach(Mirex)

# Simple linear regression test HA:slope!=0.1
lm1 <- lm(mirex~weight)
ho.coef(lm1,2,0.1)
detach(Mirex)

[Package NCStats version 0.0-12 Index]