The confidence interval here suggests that we can assume with 95% confidence that between 56.5% of adult Americans and 53.5% believe that college education is essential for success.
#Question 5b As you can see from the printed values, the Smith study is statistically significant while the Jones study is not.
#Question 5c If you do not report the p-value, you cannot tell how close the p-value is to being significant, so it can get rid of the value of running the study to not report it.
Yes there is enough evidence. The p-value is far below p = 0.05, at 0.0000234.
Source Code
---title: "Homework 2"author: "Donny Snyder"desription: "Homework 2 Submission"date: "10/17/2022"format: html: toc: true code-fold: true code-copy: true code-tools: truecategories: - hw2 - regression---```{r}library(tidyverse)library(dplyr)```# Question 1```{r, echo=T}byPassConfInt <-NAbyPassConfInt[1] <-19+ .9*(10/(sqrt(539)))byPassConfInt[2] <-19- .9*(10/(sqrt(539)))angConfInt <-NAangConfInt[1] <-18+ .9*(9/(sqrt(847)))angConfInt[2] <-18- .9*(9/(sqrt(847)))print(byPassConfInt)print(angConfInt)```The confidence interval is narrower than for angiography than for bypass surgery.# Question 2```{r, echo=T}pointEstData <-NApointEstData[1:567] <-1pointEstData[568:1031] <-0pointSD <-sd(pointEstData)pointEst <-567/1031pointConfInt <-NApointConfInt[1] <- pointEst + .95*(pointSD/(sqrt(1031)))pointConfInt[2] <- pointEst - .95*(pointSD/(sqrt(1031)))print(pointConfInt)```The confidence interval here suggests that we can assume with 95% confidence that between 56.5% of adult Americans and 53.5% believe that college education is essential for success.# Question 3```{r, echo=T}popSD <- (200-30)/4criticalVal <-1.96sampSize <- ((popSD * criticalVal)/5)^2print(sampSize)```The size of the sample should be 278.# Question 4aNull hypothesis: Womens income does not deviate from the mean income of senior-level workers.Alternative hypothesis: Womens income does deviate from the mean income of senior-level workers.```{r, echo=T}tStat <- (410-500)/(90/(sqrt(9)))degreeFree <-9-12*pt(-tStat, degreeFree, lower.tail =FALSE)pt(-tStat, degreeFree, lower.tail =FALSE)pt(tStat, degreeFree, lower.tail =FALSE)```The p value of this test statistic and degrees of freedom is 0.017.#4bThe p-value for the one-tailed test h0 < 500 is 0.0085. This is half because it is only measuring half of the distribution.#4cThe p-value for the one-tailed test h0 > 500 is 0.9915. This is because this is measuring in the opposite direction of the actual mean.#Question 5```{r, echo=T}tStatJones <- (519.5-500)/(10)tStatSmith <- (519.7-500)/(10)degreeFree <-1000-12*pt(tStatJones,degreeFree, lower.tail =FALSE)2*pt(tStatSmith,degreeFree, lower.tail =FALSE)```#Question 5bAs you can see from the printed values, the Smith study is statistically significant while the Jones study is not.#Question 5cIf you do not report the p-value, you cannot tell how close the p-value is to being significant, so it can get rid of the value of running the study to not report it.#Question 6```{r, echo=T}gas_taxes <-c(51.27, 47.43, 38.89, 41.95, 28.61, 41.29, 52.19, 49.48, 35.02, 48.13, 39.28, 54.41, 41.66, 30.28, 18.49, 38.72, 33.41, 45.02)tStatGas <- (mean(gas_taxes) -45)/(sqrt(sd(gas_taxes)/length(gas_taxes)))degreeFree <-length(gas_taxes) -12*pt(-tStatGas,degreeFree, lower.tail =FALSE)```Yes there is enough evidence. The p-value is far below p = 0.05, at 0.0000234.