library(poliscidata)
## Registered S3 method overwritten by 'gdata':
## method from
## reorder.factor gplots
\[
The \: 95\% \: C.I. \: for \: p \: is\:
\left(\hat{p} - Z_{0.025}\sqrt{\frac{\hat{p}(1 - \hat{p}}{n}}, \hat{p} + Z_{0.025}\sqrt{\frac{\hat{p}(1 - \hat{p}}{n}}\right) \: where \: Z_{0.025} \: is \: 1.96
\]
\[ A. \: \hat{p} \: = \: 0.20, \: n \: = \: 121 \: then \: 95\% \: CI \: for \: p \: is \: \left(0.1314,0.2806\right) \] \[ B. \: \hat{p} \: = \: 0.47, \: n \: = \: 100 \: then \: 95\% \: CI \: for \: p \: is \: \left(0.3694,0.5724\right) \] \[ C. \: \hat{p} \: = \: 0.40, \: n \: = \: 225 \: then \: 95\% \: CI \: for \: p \: is \: \left(0.3355,0.4672\right) \]
\[
x_{i} = 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 4, 4,5
\] \[
x_{i}^{2} = 0,0,0,1,1,1,4,4,4,4,4,9,16,16,25
\] \[
\sum_{i=1}^{n}x_{i} \: = \: 29
\] \[
\sum_{i=1}^{n}x_{i}^{2} \: = \: 89
\] \[
\bar{x} = \frac{1}{n} \sum_{i=1}^{n}x_{i} \: = \: 1.93
\]
\[ \sigma = \sqrt{\frac{\sum\limits_{i=1}^{n} \left(x_{i} - \bar{x}\right)^{2}} {n-1}} \: = \: 1.537 \] \[ SE = \sigma/\sqrt{n} \: = \: 0.10224666666 \] \[ The \: 95\% \: C.I. \: is \: \bar{x} \pm \: 2\sigma/\sqrt{n} \: = \: 1.93 \: \pm\frac{2*1.5337}{\sqrt{15}} \: = \: \left(1.138,2.722\right) \]
\[
SE = \sigma/\sqrt{n} \: = \: \frac{1.98}{\sqrt{816}} \: = \: 0.06931386415
\] \[
The \: 95\% \: C.I. \: is \: \bar{x} \pm \: 2\sigma/\sqrt{n} \: = \: 1.81 \: \pm\frac{2*1.98}{\sqrt{816}} \: = \: \left(-1.67137227168,1.94862772832\right)
\]
\[
Let \: the \: random \: variable \: X \: denote \: student's \: score
\] \[
X \sim N(62,12)
\] \[
For \: grade \: A \: a \: student \: needs \: Z \: score \: of \: 2 \: or \: above
\] \[
X = 68 + 12Z = 92
\]
\[
For \: grade \: B \: a \: student \: needs \: Z \: score \: between \: 1 \: and \: 2
\] \[
68 + (12 \times 1) \leq X \lt 68 + (12 \times 2) => 80 \leq X < 92
\] \[
For \: grade \: C \: a \: student \: needs \: Z \: score \: between \: -1 \: and \: 1
\] \[
68 + (12 \times -1) \leq X \lt 68 + (12 \times 1) => 56 \leq X < 80
\] \[
For \: grade \: C \: a \: student \: needs \: Z \: score \: between \: -2 \: and \: -1
\] \[
68 + (12 \times -2) \leq X \lt 68 + (12 \times -1) => 44 \leq X < 56
\] \[
For \: grade \: D \: a \: student \: needs \: Z \: score \: between \: -3 \: and \: -2
\] \[
68 + (12 \times -3) \leq X \lt 68 + (12 \times -2) => 32 \leq X < 44
\] \[
For \: grade \: F \: a \: student \: made \: a \: score \: of \: less \: than \: 44.
\]
We cannot calculate these sample sizes as the confidence level to achieve the margin of errors is not given.
Let us assume 95% confidence level. Z score for 95% confidence level is 1.96.
\[ sample \: size \: n \: = \left(\frac{z}{E}\right)^{2}p(1-p) \]
library(knitr)
library(kableExtra)
df <- data.frame(Cat = c("(i)", "(ii)", "(iii)", "(iv)"),
MarginOfError = linebreak(c("5%", "3%" , "1%", "0%")),
SampleSize = linebreak(c("384", "1067", "9604", "$\\infty$")))
kable(df, col.names = c("", "MargineOfError", "SampleSize"), escape = F, caption = "Sample Sizes") %>%
kable_styling(latex_options = "hold_position")
| MargineOfError | SampleSize | |
|---|---|---|
|
|
5% | 384 |
|
|
3% | 1067 |
|
|
1% | 9604 |
|
|
0% | \(\infty\) |
n = 400
sd = 4
mean = 6
\[ SE = \sigma/\sqrt{n} \: = \: \frac{4}{\sqrt{400}} \: = \: 0.2 \]
\[ The \: 95\% \: C.I. \: is \: \bar{x} \pm \: 2\sigma/\sqrt{n} \: = \: 6 \: \pm\frac{2*4}{\sqrt{400}} \: = \: \left(5.6,6.4\right) \]
The true difference is five inches. The lower bound of the C.I. is greater than
five. So, individuals' preceiving greater heights is true.
\[
n = 100 \\
\bar{x} = 47 \\
sd = 8 \\
H_{0} \: : \mu = 50 \\
H_{a} \: : \mu < 50 \\
The \: t-statistic \: is \: t \: = \frac{\widehat{X} - \mu_{0}}{s/\sqrt{n}} \: = \frac{47 - 50}{8/\sqrt{100}} \: = -3.75 \\
df \: = n - 1 \: = 99
\] Use the following link to find the one-tailed t-test p-value : https://www.socscistatistics.com/pvalues/tdistribution.aspx The p-value is 0.000149 < 0.05. So reject the null hypothesis. The county commissioner is a Republican and is wrong on public safety policy.