Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

hoCoef

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


Description

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

Usage

hoCoef(object, term = 2, bo = 0, alt = c("two.sided", "less", "greater"))

Arguments

object

A lm object.

term

A single numeric that indicates which term in the model to use in the hypothesis test.

bo

The null hypothesized parameter value.

alt

A string that identifies the “direction” of the alternative hypothesis. The strings may be "less" for a “less than” alternative, "greater" for a “greater than” alternative, or "two.sided" (DEFAULT) for a “not equals” alternative.

Details

The “direction” of the alternative hypothesis is identified by a string in the alt argument.

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

A matrix that contains the term number, hypothesized value, parameter estimate, standard error of the parameter estimate, t test statistic, degrees-of-freedom, and corresponding p-value.

Author(s)

Derek H. Ogle, derek@derekogle.com

See Also

Examples

# Simple linear regression test HA:slope!=0.1
lm1 <- lm(mirex~weight, data=Mirex)
hoCoef(lm1,2,0.1)

FSA

Simple Fisheries Stock Assessment Methods

v0.8.32
GPL (>= 2)
Authors
Derek Ogle [aut, cre] (<https://orcid.org/0000-0002-0370-9299>), Powell Wheeler [aut], Alexis Dinno [aut] (Provided base functionality of dunnTest())
Initial release
2021-1-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.