[1] 0.001847065
IMS1 Ch. 19-21
Math 215
run17 1 datasettime is finishing time in minutesSummary statistics
| n | mean | sd | min | max |
|---|---|---|---|---|
| 100 | 99.02 | 17.93 | 53.27 | 139.07 |
Mathematical Model for \(T\)
The \(T\) statistic (\(T\) score) will have will have a \(t\)-distribution with \(df=n-1\) degrees of freedom if the following conditions are met:
pt and double it (the t-distribution is symmetric)births14 1 datasethabit is smoking habit (“smoker” or nonsmoker”)weight is birth weight in pounds
| habit | n | mean | sd |
|---|---|---|---|
| nonsmoker | 867 | 7.27 | 1.23 |
| smoker | 114 | 6.68 | 1.60 |
The observed difference in means is \[\begin{array}{lcr}\bar{x}_n-\bar{x}_s &=& 7.27-6.68\\ &=& 0.59\end{array}\]
Note
When the null hypothesis is true and the following conditions are met, the \(T\) score has a \(t\)-distribution with \(df=n_1+n_2-2\) degrees of freedom.
t_test function in the infer package to calculate a p-value. We can also relax the equal variance assumptionucla_textbooks_f18 1 datasetbookstore_new is price of new book at bookstoreamazon_new is price of new book on Amazonucla_textbooks_f18 <- ucla_textbooks_f18 |>
mutate(price_diff = bookstore_new - amazon_new)
ucla_textbooks_f18# A tibble: 68 × 5
subject course_num bookstore_new amazon_new price_diff
<fct> <fct> <dbl> <dbl> <dbl>
1 American Indian Studies M10 48.0 47.4 0.520
2 Anthropology 2 14.3 13.6 0.710
3 Arts and Architecture 10 13.5 12.5 0.97
4 Asian M60W 49.3 55.0 -5.69
5 Astronomy 4 120. 125. -4.83
6 Communication 10 17.0 11.8 5.18
7 Comparative Literature 2CW 12.0 10.9 1.09
8 Dance 10 26.8 38.9 -12.2
9 English 19 9.96 8.99 0.97
10 English Composition 1A 40.0 35 4.97
# ℹ 58 more rows

| n | mean | median | sd | iqr |
|---|---|---|---|---|
| 68 | 3.58 | 0.625 | 13.4 | 3.98 |