Tests if a promotion mean \(\mu\) differ from a specific value \(\mu_0\).
\[T = \frac{\bar{X} - \mu_0}{s}\sqrt{n}\] with \[s = \sqrt{\frac{1}{n-1}\sum_{i=1}^n (X_i - \bar{X})^2}\]
and \[\bar{X} = \frac{1}{n}\sum_{i=1}^n X_i\]
Rejection \(H_0\) if for the observed value t of T:
\(t \lt t_{\alpha/2, n-1}\) or \(t \gt t_{1-\alpha/2, n-1}\)
\(t \gt t_{1-\alpha, n-1}\)
\(t \lt t_{\alpha,n-1}\)
\(\rho = 2P(T \le (-|t|))\)
\(\rho = 1 - P(T \le t)\)
\(\rho = P(T \le t)\)
To test the hypothesis that the mean systolic blood pressure in a certain population equals 140 mmHg. The dataset at hands has measurements on 55 patients.
#Blood_pressure dataset
no <- seq(1:55)
status <- c(rep(0, 25), rep(1, 30))
mmhg <- c(120,115,94,118,111,102,102,131,104,107,115,139,115,113,114,105,
115,134,109,109,93,118,109,106,125,150,142,119,127,141,149,144,
142,149,161,143,140,148,149,141,146,159,152,135,134,161,130,125,
141,148,153,145,137,147,169)
blood_pressure <-data.frame(no,status,mmhg)
t.test(blood_pressure$mmhg,mu=140,alternative="two.sided")
##
## One Sample t-test
##
## data: blood_pressure$mmhg
## t = -3.8693, df = 54, p-value = 0.0002961
## alternative hypothesis: true mean is not equal to 140
## 95 percent confidence interval:
## 124.8185 135.1815
## sample estimates:
## mean of x
## 130
t.test(blood_pressure$mmhg,mu=140,alternative="less")
##
## One Sample t-test
##
## data: blood_pressure$mmhg
## t = -3.8693, df = 54, p-value = 0.0001481
## alternative hypothesis: true mean is less than 140
## 95 percent confidence interval:
## -Inf 134.3253
## sample estimates:
## mean of x
## 130
t.test(blood_pressure$mmhg,mu=140,alternative="great")
##
## One Sample t-test
##
## data: blood_pressure$mmhg
## t = -3.8693, df = 54, p-value = 0.9999
## alternative hypothesis: true mean is greater than 140
## 95 percent confidence interval:
## 125.6747 Inf
## sample estimates:
## mean of x
## 130