# How to test that the regression coefficient = 1 [duplicate]

I'm doing a market model calculation with OLS and I'm using R. I have a sample date with variable Rm and Ri. Its a market model off asset returns as

$$R_i = \alpha + \beta R_m$$

I have fitted a linear model, and now I have to run a Market Adjusted return model for $$\beta = 1$$, using t test statistics with hypothesis as H0: $$\beta$$ =1 ; H1: $$\beta$$ <>1

Please help how to perform a test that $$\beta$$ =1

• Did you try ?t.test and ?lm? Commented Aug 27, 2020 at 1:05
• In R you could just do t.test(Rm, Ri - intercept) where you obtain intercept from your linear model Commented Aug 27, 2020 at 6:20

The t-test is implemented in R. For a dataset "x" with columns "y" (continuous) and "x" (binary categorical):

t.test(y~x, data, alternative = "two-sided", var.equal = TRUE)


You can also display the results of linear models:

fit <- lm(y~x, data)
summary(fit)


If the regression model is appropriate (e.g., "x" is coded as integer values), it will give similar results as the t-test for β1.

• This is not quite correct. The default in R is to do an unequal-variance t-test (Welch year), while the lm linear model will assume equal variances.
– Dave
Commented Aug 27, 2020 at 0:43
• I agree with Dave. Set var.equal = TRUE. Also, I would suggest alternative = “two.sided” (default) as I don’t think the OP is particularly interested in one side. Commented Aug 27, 2020 at 1:08
• The test is of coefficient = 1 not 0 Commented Aug 27, 2020 at 1:40