Testing whether the regression coefficient is significantly less than 1 (one-tailed t-test)

家住魔仙堡 提交于 2021-01-29 09:05:52

问题


I performed a simple linear regression and using summary() I get the result of a two-tailed t-test testing whether the regression coefficient is significantly different from 0.

lmb <- lm(logspec ~ logfreq)

I would like to perform a one-tailed t-test testing whether the regression coefficient is less than 1.

I read in previous threads about the use of offset() to set the comparison value different from 0 but I am not sure if it does what I would like to see happen:

t <- lm(logspec ~ logfreq + offset(1*logfreq))

A possible way to perform a one-tailed t-test I believe is the following:

res <- summary(lmb)
d <- pt(coef(res)[, 3], lmb$df, lower.tail=FALSE)

In which the upper tail is the one of interest and the quantiles of a t-distribution are calculated, but here I am also not entirely sure if this connects to what I would like to achieve.

So I have found these 2 methods, which aim at setting the comparison value different from 0 and performing a one-tailed t-test but I am not sure whether they are the way to go and if (and how) I can combine both?

来源:https://stackoverflow.com/questions/56542744/testing-whether-the-regression-coefficient-is-significantly-less-than-1-one-tai

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!