The pt
and qt
will give you the p-value and critical value from the t-distribution, respectively.
Critical value for p = 0.05, degrees of freedom = 10
qt(0.025, df = 10)
## [1] -2.228139
p-value for a critical value of 2, degrees of freedom = 10
pt(2, df=10)
## [1] 0.963306
The t.test
function will calculate a null hyphothesis test using the t-distribution.
t.test(Math.SAT ~ Sex, data = sat)
##
## Welch Two Sample t-test
##
## data: Math.SAT by Sex
## t = -1.9117, df = 158.01, p-value = 0.05773
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -59.3527145 0.9685682
## sample estimates:
## mean in group F mean in group M
## 597.6829 626.8750