Jadhav_Sanyogita_0763756_R_Assign4

pdf

School

Trent University *

*We aren’t endorsed by this school

Course

1051H

Subject

Statistics

Date

Feb 20, 2024

Type

pdf

Pages

3

Uploaded by EarlAntelope662

Report
MATH1051H - R Assignment 4 Sanyogita Jadhav - 0763756 2022-12-02 Question 0: Academic Integrity I am aware that I can discuss the questions on this assignment with others. However, showing my files or code to another student (allowing them to copy), or having someone show their files or code with me (copying), in any way is considered cheating and will be penalized according to Trent’s Academic Integrity policies. Question 1: One Proportion Confidence Interval # Compute the sample proportion p = 16870 / 21355 p ## [1] 0.7899789 # Computing the margin of error for a 99% confidence interval alpha = ( 1-0.99 ) z = qnorm( 1 - alpha/ 2 ) z ## [1] 2.575829 ME = z*sqrt((p*( 1 -p))/ 16870 ) ME ## [1] 0.008077905 # Finding a 99% confidence interval and interpret ci = c(p-ME, p+ME) ci ## [1] 0.7819010 0.7980568 We are 99% confident that the proportion of people from the random drug test on elected officials that said “yes” is between 79.8% and 78.2%. 1
Question 2: Hypothesis Testing of a Population Mean Twenty five years ago, entering first-year high school students could do an average of 24 push-ups in 60 seconds. To see whether this remains true today, a random sample of 36 first-year students was chosen. If their average was 22.5 with a sample standard deviation of 3.1, at a significance level of 5% can we conclude that the mean is no longer equal to 24? H 0 : µ = 24 vs H A : µ ̸ = 24 The null hypothesis is equal to 24 and the alternate hypothesis is not equal to 24 # Computing the test statistics xbar.q2 = 22.5 n.q2 = 36 sd.q2 = 3.1 mu0.q2 = 24 SE.q2 = sd.q2 / sqrt(n.q2) z_stat.q2 = (xbar.q2 - mu0.q2) / SE.q2 z_stat.q2 ## [1] -2.903226 p_val.q2 = pnorm( 2.903226 , lower.tail = FALSE)* 2 p_val.q2 ## [1] 0.0036934 d) Do you reject the null hypothesis? Yes, we can reject the null hypothesis as the alpha value is 0.05 and the p value is 0.0036934. This means that the p value is smaller than the alpha which means we can reject the null hypothesis. e) Interpret your results Yes, we can conclude that the true mean is no longer equal to 24 at 5% of significance as we have enough evidence to reject the null hypothesis since p-value is less than the alpha. Question 3: Hypothesis testing of a population proportion A standard drug is known to be effective in 72 percent of cases in which it is used to treat a certain infection. A new drug has been developed, and testing has found it to be effective in 42 cases out of 50. At 1% significance level, is this strong enough evidence to show that the new drug is more effective than the old one? H 0 : p = 0 . 72 vs.H A : p > 0 . 72 2
# Computing the test statistics p0 = 0.72 n3 = 50 x3 = 42 p_hat3 = x3/n3 se3 = sqrt(p0*( 1 -p0)/n3) z_stat3 = (p_hat3 - p0) / se3 z_stat3 ## [1] 1.889822 # Computing the p-value pvalue3 = pnorm(z_stat3, lower.tail= FALSE) pvalue3 ## [1] 0.02939086 d) Do you reject the null hypothesis? Yes, we can reject the null hypthesis because the null hypothesis is 0.72 and the p-value is 0.02939086, which indicates that p-value is smaller than the null hypthesis and it can be rejected. e) Interpret your results Yes, at 1% significance level, the evidence is strong enough to show that the new drug is more effective than the old one as we can reject the 72 percent cases due to the p-value being smaller than the alpha, which tells us that the new drug is more effective than the old one. 3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help