Question
These Questions are ONLY on rStudio. Copy and paste the below into rStudio to complete. This is the whole assignment, nothing else added. You need
These Questions are ONLY on rStudio.
Copy and paste the below into rStudio to complete.
This is the whole assignment, nothing else added. You need to know what 'packages' to download.
Here is the subject and section we are on:
- ModernDive - https://moderndive.com/index.html
- Chapters 8-9 (long, simulation approach to CI/HT). These two chapters providemore background than necessary, but they illustrate concepts nicely.
- Appendix B
- OpenIntro Statistics - https://www.openintro.org/book/os/
- Chapter 6.1-6.2
- Chapter 7.1-7.3
## Exercise 1
In an experiment to test ginkgo biloba, subjects were assigned randomly to take ginkgo biloba supplements or a placebo. Their memory was tested to see whether it improved. (Solomon,P.R., Adams, F., Silver, A., Zimmer, J. and De Veaux, R.D. Journal of the American Medical Assocation Vol. 288 pp.835-840 (2002), "Ginkgo for Memory Enhancement A Randomized Controlled Trial")
The data is named `memory` in the `DS705data` package. Numeric scores represent the difference in performance on a logical memory test before and treatment (before-after). This is LOCATED at the bottom of this post.
### Question 1
Load and inspect the data. Consider the format of the data set and any missing values. How many cases are recorded in the data set? (The data is not formatted in the standard form of one case per row. You'll need to look more closely than just getting the dimension of the data frame.)
### Answer 1
```{r, message=FALSE}
```
---
### Question 2
What was the difference in average increase performance scores between the Gingko and Placebo groups (Gingko - Placebo)?
### Answer2
```{r}
```
---
### Question 3
Are the conditions satisfied to build a confidence interval using the t-distribution?
For reference, here is where to find the associated conditions for applying the five basic normal-based method (t-test if speaking about means) in the presentation for this week.
- Proportions procedures presentation: - Single proportion: conditions in general (slide 6), applied to an example (slide 12) - Two proportions: conditions in general (slide 16), applied to an example (slide 20) - Means procedures presentation: - Single mean: conditions in general (slide 7), applied to an example (slide 11) - Paired means: conditions in general and applied to an example (slide 17) - Difference in means: conditions in general (slide 23), applied to an example (slide 28)
### Answer3
```{r, message=FALSE, warning=FALSE}
```
Options: - No. The sample sizes are not equal for the two groups, so conditions are not met. - No. There is an extreme outlier in the Gingko group, so conditions are not met. - Yes. The sample sizes are both large, and the sample data are nearly normally distributed for both groups. So, conditions are met. - No. The sample sizes are both large, but the sample data are not nearly normally distributed for either group. So, conditions are not met.
---
### Question 4
Construct and interpret a 95% confidence interval to estimate the difference in average increase performance scores between the Gingko and Placebo groups (Gingko - Placebo). What is the lower bound of the resulting confidence interval? (For simplicity, do not assume equal variance for the two groups.)
### Answer4
```{r}
```
---
### Question 5
Construct and interpret a 95% confidence interval to estimate the difference in average increase performance scores between the Gingko and Placebo groups (Gingko - Placebo). Which of the following is the correct interpretation of the confidence interval? (For simplicity, do not assume equal variance for the two groups.)
### Answer5
```{r}
```
Options:
- We are 95% confident that the difference in average change in performance scores between the Gingko and Placebo groups (Gingko - Placebo) is between 4.23 and 5.22 units. - 95% of the sample differences are between -2.26 and 0.28 points. - We are 95% confident that the difference in average change in performance scores between the Gingko and Placebo groups (Gingko - Placebo) is between -2.26 and 0.28 units. - Reject $H_0$. There is sufficient evidence to conclude that there is a difference in average changes in performance between the Gingko and Placebo (Gingko-Placebo) groups. - Fail to reject $H_0$. There is not sufficient evidence to conclude that there is a difference in average changes in performance between the Gingko and Placebo (Gingko-Placebo) groups.
---
## Exercise 2
The `esoph` dataset from the `datasets` package in R contains data from a case-control study of (o)esophageal cancer in Ille-et-Vilaine, France. See the help file (`?esoph`) for more information. Load this data.
Inspecting this data should show that the number of cases and number of controls were recorded for each combination of age group, alcohol consumption, and tobacco consumption categories (88 total). For the following exercises, we will be ignoring the alcohol and tobacco consumption information.
### Question 6
Summarize the `esoph` data by combining the alcohol and tobacco categories. Your resulting table should have 6 rows, with three columns: agegp, cases, and controls. For reference, there was 1 case and 115 controls in the 25-34 age group. How many individuals were in the 55-64 year age group?
As a hint for completing this task: ignore the alcohol and tobacco variables. Group the data by age category. Within each age group, compute the total number of cases and total number of controls.
### Answer6
```{r}
```
---
### Question 7
Suppose that the researchers hypothesized that the prevalence of (o)esophageal cancer significantly increases between the 45-54 and 55-64 year age groups. Are the conditions satisfied to test this hypothesis using a normal-distribution-based procedure? Why?
Hint: the slides referenced in question 3 apply here as well.
### Answer7
```{r}
```
Options:
- No. The sample responses are not normally distributed. - Yes. The sample sizes for each group were both greater than 30. - Yes. 46 and 76 are both greater than 30. - Yes. There were at least 10 successes and 10 failures in both groups. - No. The ratio of successes to failures is less than 10 in both groups.
---
### Question 8
Test to determine whether there is significant evidence of an increase in cancer prevalence between the 45-54 and 55-64 year age groups. What is the p-value associated with this test?
Note: The word "increase" is important here.
### Answer8
```{r}
```
---
### Question 9
Which of the following is the most appropriate conclusion to the hypothesis test above?
### Answer9
```{r}
```
Options:
- Reject $H_0$. We have significant evidence that the proportion of (o)esophageal cancer is greater in the 55-64 year group compared to the 45-54 year group. - Reject $H_0$. There is insufficient evidence the conclude that the proportion of (o)esophageal cancer is greater in the 55-64 year group compared to the 45-54 year group. - The difference in proportions is equal to 0.098. - Fail to reject $H_0$. We do not have significant evidence that the proportion of (o)esophageal cancer is greater in the 55-64 year group compared to the 45-54 year group. - None of the above.
---
## Exercise 3
Which inference procedure is most appropriate for the following scenarios? Each choice may be used more than once.
a. Single Proportion b. Difference in Proportions c. Single Mean d. Paired Means e. Difference in Means
### Questions 10 - 19
10. Do women order dessert more often than men? 85 men and 73 women at a restaurant were observed to see if they ordered dessert.
11. Do customers at Walmart wait in the checkout line on average longer than 5 minutes? 150 randomly selected Walmart customers were observed and their wait times were recorded.
12. When road conditions are snowy, do people who have four wheel drive vehicles drive faster than those who have two wheel drive vehicles? 45 four wheel drive vehicles and 40 two wheel drive vehicles were clocked. 13. Suppose that in a simple random sample of 350 Americans, that 180 say they believe there is life in outer space. Do a majority of Americans believe there is life in outer space?
14. To determine if dentists make people more nervous than a general doctor, the blood pressure of 25 subjects were measured in a dental setting and in an unrelated medical setting.
15. Last year honeybees weighed 0.87 grams on average. Are this year's bees significantly heavier? 50 bees were captured and weighed.
16. Do people with high fiber diets have higher vitamin D levels? Vitamin D levels are recorded for random samples of 43 people with high fiber diets and 47 people with regular diets.
17. Will plants grow larger in artificially fertilized soil than in organic soil? 55 plants were grown in organic soil and 55 plants in artificially fertilized soil.
18. Does a new technique to test body fat percentage in athletes provide estimates similar to the older, more expensive technique? 50 athletes were recruited and had their body fat measured measured with both techniques.
19. Is the recovery time from ACL surgery shorter for patients who have health insurance? 300 patients with health insurance and 200 patients without health insurance were studied for their recovery time after the ACL surgery.
### Answer10-19
---
Here is the raw data from the memory packet needed:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started