title: “lab7Aidan Boyle” output: html_document: default pdf_document: default date: “2023-11-06” —

R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

Question 1 - You will notice that these three values do not add up to 100%. Why do you think that happened? Hint: It has nothing to do with data collection and everything to do with how values are reported.

I think since this error was so small, it must have been due to rounding. Not that there was an error, but to simplify the statistics, they decided to round their statistics to the nearest whole number which resulted in a slight errorCondition(

Question 2 - State the hypotheses our researcher has asked us to test. To produce the necessary mathematical notation for the 6 steps, copy and paste the following into the white space in your Markdown and add in the necessary pieces to reflect your hypotheses.

the proportion of all Americans who feel that religion is not important is more than 20% Step 1: \[H_0:, H_a:\] ## Question 3 - Does the CLT hold for these data? Explain why or why not. Yes because the sample size is sufficiently large (n=1837) and the sampling was random

Question 4 - Write out the two pieces of information you need for Step 2. Hint: Recall from the last lab that the sample size is 1837 people.

The sample proportion (p-hat) and the standard error. ## Question 5 - Compute and interpret z. Make sure to show your work. z= .25 −.2 ——- SEp0 z = .05 / SE SEp0 = sqrt[0.20 * (1 - 0.20) / 1837] = 0.00933 z = 5.36 A z-score of 1.197 indicates that the sample proportion of .25 is approximately 1.197 standard errors above the population proportion assumed in the null hypothesis (.2).

Question 6 - Suppose z=3. In a normal distribution with mean 0 and standard deviation 1, what is the probability of getting a value greater than or equal to 3? In other words, what is P(z≥3)?

P(z≥3) = 0.0013 or 0.13%.<– using a standard normal distribution table

Question 7 - Step 5 in a hypothesis test is to compute a p-value. If the null hypothesis is correct, what is the probability of getting a test statistic as or even more extreme as the value of z you computed in Question 5? In other words, compute P(z≥TestStatistic | p=.2)

P(z≥TestStatistic | p=.2) = 0.1151 or 11.51%

Question 8 - Step 6 involves giving a clear response to our client’s research question: Do these data provide evidence that the true percent of Americans who believe religion is not very important is more than 20%? Explain your reasoning.

Since our p value is greater than .05, we fail to reject the null hypothesis. There isn’t enough evidence to support the claim that the true percent of Americans who believe religion is not very important is more than 20%.

Question 9 - Build and interpret a 95% confidence interval for the proportion of Americans who believe that religion is not very important.

Confidence Interval = 0.25 ± 1.96 * SE .025 +/- .0198 Upper bound = .2698 Lower bound = .2302 We are 95% confident that the proportion of Americans who believe that religion is not very important is between .2302 and .2698

Question 10 - Respond to our client’s research question using the confidence interval: Do these data provide evidence that the true percent of Americans who believe religion is not very important is more than 20%? Explain your reasoning.

Our confidence interval of .2302 to .2698 proves that there is strong evidence to suggest that the true percent of Americans who believe religion is not very important is more than 20%.

Question 11 - Did you get the same answer in Question 8 and Question 10?

No - when using different methods I got different results