0

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?

  • 1
    This is question is better suited for CrossValidated as it relates to statistical methodology more than programming. Along those lines these posts discuss your question at length: https://stats.stackexchange.com/questions/137118/testing-a-regression-coefficient-against-1-rather-than-0, https://stats.stackexchange.com/questions/245350/how-to-compare-my-slope-to-1-rather-than-0-using-regression-analysis-and-t-distr?noredirect=1&lq=1, https://stats.stackexchange.com/questions/9825/changing-null-hypothesis-in-linear-regression?rq=1. – emilliman5 Jun 11 '19 at 12:00
  • Second, if the two methods you tried give the same result then you are good to go. Based on a quick read of the linked posts above you would not combine the two methods – emilliman5 Jun 11 '19 at 12:02
  • Here is a nice answer: https://stats.stackexchange.com/questions/111559/test-model-coefficient-regression-slope-against-some-value –  Jun 11 '19 at 12:25

0 Answers0