Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Use R Studio Programming language to answer the Three questions Please provide f

ID: 3267788 • Letter: U

Question

Use R Studio Programming language to answer the Three questions Please provide formulas for each question that can be pasted into R studio console.

A Pepsi ad claims that “more than 65% of the Coke drinkers said they preferred the taste of Pepsi.” According to the data provided by Pepsi, 87 Coke drinkers took the “Pepsi Challenge” and 61 prefered the taste of Pepsi:

• Based on the data, use prop.test() funtion to calculate a 99% condence interval for proportion of coke drinkers who prefer pepsi.

• If you want to prove the claim made by that ad, what kind of alternative hypothesis you should come up with?

• Use prop.test() to run the test. What is the p value? On a 5% signicance level, can you reject the null hypothesis?

Explanation / Answer

a) the R-code as follows

prop.test(61,87,p=.65,alternative="less",conf.level=.99,correct=T)

ans-99% ci is  ( 0.0000000 ,0.8055982)

b) as the company claims that more than 65% prefer pepsi so our null should be

H: p>=.65 vs K: p<.65

as in thus situation power function is incrasing so we can test H1: p=.65 vs K: p<.65 ...they will givw us the same result

c) if we run test at .01 significance level the p-value is .8127 ... in this case also p-value same that is more than .05 ..so we cant reject the null hypothesis...

result of R -consol-

  

1-sample proportions test with continuity correction

data: 61 out of 87, null probability 0.65
X-squared = 0.7883, df = 1, p-value = 0.8127
alternative hypothesis: true p is less than 0.65
99 percent confidence interval:
0.0000000 0.8055982
sample estimates:
p
0.7011494