R/FSAUtils.R
hoCoef.Rd
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.
hoCoef(object, term = 2, bo = 0, alt = c("two.sided", "less", "greater"))
object | A |
---|---|
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 |
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.
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.
# Simple linear regression test HA:slope!=0.1 lm1 <- lm(mirex~weight, data=Mirex) hoCoef(lm1,2,0.1)#> term Ho Value Estimate Std. Error T df p value #> 2 0.1 0.01216125 0.002359903 -37.22135 120 9.341981e-68