Calculating T-Statistic

Calculating t statistic

R uses this t-value to determine the p value.