library(readr)
library(fastR2)

School <- read_csv("~/Prob&Stats/School.csv")

Analysis of the Survey Questions for Statistical Significance

#Question 4
mean(School$Q4)
## [1] 4.218182
sd(School$Q4)
## [1] 0.708815

First, set the value for alpha to be 0.05 to test our p-value against. The expected value for the null hypothesis is 3.
\(H_o\): \(\mu = 3\)

\(H_a\): \(\mu \neq 3\)
Z-score must be computed: \[Z = \frac{4.218182-3}{.708815/\sqrt{110}} = 18.02501\]
The test is two side, both sides of the distribution must be accounted for the p-value.
P-value:

1 - pt(18.02501, 109)
## [1] 0
#Question 5
mean(School$Q5)
## [1] 4.163636
sd(School$Q5)
## [1] 0.5985805

First, set the value for alpha to be 0.05 to test our p-value against. The expected value for the null hypothesis is 3.
\(H_o\): \(\mu = 3\)

\(H_a\): \(\mu \neq 3\)
Z-score must be computed: \[Z = \frac{4.163636-3}{.5985805/\sqrt{110}} = 20.38877\]
The test is two side, both sides of the distribution must be accounted for the p-value.
P-value:

1 - pt(20.38877, 109)
## [1] 0
#Question 6
mean(School$Q6)
## [1] 3.863636
sd(School$Q6)
## [1] 0.840241

First, set the value for alpha to be 0.05 to test our p-value against. The expected value for the null hypothesis is 3.
\(H_o\): \(\mu = 3\)

\(H_a\): \(\mu \neq 3\)
Z-score must be computed: \[Z = \frac{3.863636-3}{0.840241/\sqrt{110}} = 10.78011\]
The test is two side, both sides of the distribution must be accounted for the p-value.
P-value:

1 - pt(10.78011, 109)
## [1] 0
#Question 7
mean(School$Q7)
## [1] 4.036364
sd(School$Q7)
## [1] 0.753308

First, set the value for alpha to be 0.05 to test our p-value against. The expected value for the null hypothesis is 3.
\(H_o\): \(\mu = 3\)

\(H_a\): \(\mu \neq 3\)
Z-score must be computed: \[Z = \frac{4.036364-3}{0.753308/\sqrt{110}} = 14.42899\]
The test is two side, both sides of the distribution must be accounted for the p-value.
P-value:

1 - pt(14.42899, 109)
## [1] 0
#Question 8
mean(School$Q8)
## [1] 3.972727
sd(School$Q8)
## [1] 0.8179084

First, set the value for alpha to be 0.05 to test our p-value against. The expected value for the null hypothesis is 3.
\(H_o\): \(\mu = 3\)

\(H_a\): \(\mu \neq 3\)
Z-score must be computed: \[Z = \frac{3.972727-3}{0.8179084/\sqrt{110}} = 12.47334\]
The test is two side, both sides of the distribution must be accounted for the p-value.
P-value:

(1 - pt(12.47334, 109))
## [1] 0