The ASTA team
library(mosaic)
1 - pdist("t", q = 1.89, df = 3)
## [1] 0.07757725
The book also discusses one-sided t-tests for the mean, but we will not use those in the course.
count <- 1200 * 0.52 # number of individuals preferring tax increase
prop.test(x = count, n = 1200, correct = F)
##
## 1-sample proportions test without continuity correction
##
## data: count out of 1200
## X-squared = 1.92, df = 1, p-value = 0.1659
## alternative hypothesis: true p is not equal to 0.5
## 95 percent confidence interval:
## 0.4917142 0.5481581
## sample estimates:
## p
## 0.52
lower_tail <- pdist("binom", q = 13, size = 30, prob = 0.3)
1 - lower_tail
## [1] 0.04005255
sex
.Chile <- read.delim("https://asta.math.aau.dk/datasets?file=Chile.txt")
binom.test( ~ sex, data = Chile, p = 0.5, conf.level = 0.95)
##
##
##
## data: Chile$sex [with success = F]
## number of successes = 1379, number of trials = 2700, p-value =
## 0.2727
## alternative hypothesis: true probability of success is not equal to 0.5
## 95 percent confidence interval:
## 0.4916971 0.5297610
## sample estimates:
## probability of success
## 0.5107407
prop.test( ~ sex, data = Chile, p = 0.5, conf.level = 0.95, correct = FALSE)
(note the additional argument correct = FALSE
).
Space, Right Arrow or swipe left to move to next slide, click help below for more details