0
$\begingroup$

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

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

1 Answer 1

0
$\begingroup$

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.

$\endgroup$
3
  • 1
    $\begingroup$ 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. $\endgroup$
    – Dave
    Commented Aug 27, 2020 at 0:43
  • $\begingroup$ 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. $\endgroup$ Commented Aug 27, 2020 at 1:08
  • $\begingroup$ The test is of coefficient = 1 not 0 $\endgroup$
    – Glen_b
    Commented Aug 27, 2020 at 1:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.