In: Statistics and Probability
**A company developed two commercials, A and B, to advertise for their product. Two random test groups were put together each with 100 individuals and each group watched one commercial and states if they would buy the product. Group A had 25 of the individuals say they would buy the product and Group B had 20 individuals say they would buy the product. It was concluded that commercial A was more effective.**
```{r}
```
##b
**A randomized experiment was conducted to see if hormonal therapy
was helpful for postmenopausal women in reducing cancer risk. One
group was given a placebo and a second group administered the
treatment. The treatment group showed that 107 of 8506 individuals
developed cancer while the placebo group had 88 of 8102 individuals
developed cancer. Does this data indicate that the therapy was
effective. Use 1% level of significance**
```{r}
```
##c
**The following data comes from the FL Student Survey data. The two
vectors represent the number of times in the past month that an
individual read a newspaper, grouped by gender.**
**Test the hypothesis that females on average have read the
newspaper more than males. Be sure to state your conclusion.
Compare the conclusion drawn through hypothesis testing to the
conclusion you would draw from a confidence interval. Use 5% level
of significance.**
```{r}
females<-c(5,3,6,3,7,1,1,3,0,4,7,2,2,7,3,0,5,0,4,4,5,14,3,1,2,1,7,2,5,3,7)
males<-c(0,3,7,4,3,2,1,12,1,6,2,2,7,7,5,3,14,3,7,6,5,5,2,3,5,5,2,3,3)
Please Solve using R studio codes wih explanation
a)
R Code:
R output:
Explanation:
Hypothesis:
The null and alternative hypotheses are defined as,
This is a right-tailed test.
P-value
The two proportions z test is used to test the hypothesis
From the result summary,
P-value = 0.1986
Conclusion:
Since the p-value is greater than 0.05 at a 5% significance level, the null hypothesis is not rejected hence there is not sufficient evidence to conclude that commercial A was more effective.
b)
R Code:
R output:
Explanation:
Hypothesis:
The null and alternative hypotheses are defined as,
This is a left-tailed test.
P-value
The two proportions z test is used to test the hypothesis
From the result summary,
P-value = 0.879
Conclusion:
Since the p-value is greater than 0.01 at a 1% significance level, the null hypothesis is not rejected hence there is not sufficient evidence to conclude that hormonal therapy was effective.
c)
R Code:
R output:
Explanation:
The null and alternative hypotheses are defined as,
This is a left-tailed test.
P-value
The two-sample t-test assuming equal variance is used to test the hypothesis
From the result summary,
P-value = 0.7927
Conclusion:
Since the p-value is greater than 0.05 at a 5% significance level, the null hypothesis is not rejected hence there is not sufficient evidence to conclude that females on average have read the newspaper more than males.