An example of a two-sample t-test in R







This is an example from my MS Quant Methods course. Some of the description leans on some context from lectures I gave in person, which I don’t provide additional context here. If you’re really familiar with linear combinations of random variables, you should still be able to follow the narrative.

If you’re interested in just the data & R portion of this, skip to minute 10 of the video. The first 10 minutes conceptually set up the hypothesis test and context for the hypothesis test.

This video goes through an example of conducting a two-sample t-test of whether value stocks outperform growth stocks. I go through how to download data from Ken French’s website on 6 double sorted portfolios on size and B/M. I then show how to test (for the subsample of small firms) whether there is a value premium using standard commands in R.

Leave a Reply