By Luis Olortegui
Updated Aug 30, 2022
The t‑distribution, also known as the Student’s t‑distribution, was first introduced in 1908. It is essential for calculating confidence intervals and conducting hypothesis tests when sample sizes are small or data are limited. Because the underlying mathematics is complex, creating accurate graphs typically requires computer software.
Open Microsoft OpenOffice or your preferred spreadsheet application. In cell A1 type DOF (Degrees of Freedom). In cell A2 type t and in cell B2 type Y. In cells B1, C1, and D1 enter the values 2, 4, and 6 respectively – these will represent the degrees of freedom for the curves you will plot.
In cell A2 input the value –5. In cell A3 enter the formula =A2+0.2 to generate increments of 0.2. Copy this formula down for the next 50 rows (A3 through A53).
In cell B3 enter the t‑distribution formula:
=(1/SQRT($B$1*PI()))*GAMMA(($B$1+1)/2)/GAMMA($B$1/2)*POWER(1+($A3*$A3/$B$1),-5*($B$1+1))
This formula calculates the density values for 2 degrees of freedom.
Copy B3 and paste it into C3 and D3. Edit the references in C3 to replace $B$1 with $C$1, and in D3 replace $B$1 with $D$1 so that each column uses its own degrees‑of‑freedom value.
Select B3, C3, and D3 and copy them. Paste the block of three cells down through row 53, generating three parallel data series.
From the menu choose Insert → Chart. Select the XY Scatter chart type with smooth lines, then click Next.
Ensure no data series are pre‑selected. If any exist, click Remove to clear them.
Click Add, then X Values. Use the icon on the right to highlight cells A3 through A53 for the horizontal axis.
Click Y Values, then highlight cells B3 through B53 for the vertical axis.
Repeat steps 3 and 4 two more times, once for cells C3–C53 and once for cells D3–D53. Click Finish. The resulting chart will display three overlapping curves corresponding to 2, 4, and 6 degrees of freedom.
Excel can be used in the same way – the formulas are identical; only the chart menu differs slightly. If you need a single t‑distribution curve, stop after Step 4. Feel free to adjust the degrees‑of‑freedom values in row 1 to suit your analysis.
Verify that the cell in column A labeled zero actually contains the value 0. Some computers may return a very small approximation instead of an exact zero, which can affect subsequent calculations.