In: Statistics and Probability
1.) Calcium is an essential mineral that regulates the heart, is important for blood clotting and for building healthy bones. The National Osteoporosis Foundation recommends a daily calcium intake of 1000-1200 mg/day for adult men and women. While calcium is contained in some foods, most adults do not get enough calcium in their diets and take supplements. Unfortunately some of the supplements have side effects such as gastric distress, making them difficult for some patients to take on a regular basis.
A study is designed to test whether there is a difference in mean daily calcium intake in adults with normal bone density, adults with osteopenia (a low bone density which may lead to osteoporosis) and adults with osteoporosis. Adults 60 years of age with normal bone density, osteopenia and osteoporosis are selected at random from hospital records and invited to participate in the study. Each participant's daily calcium intake is measured based on reported food intake and supplements. The data are shown below.
Normal_Bone_Density<-c(1200,1000,980,900,750,800)
Osteopenia<-c(100,1100,700,800,500,700)
Osteoporosis<-c(890,650,1100,900,400,350)
G1=Normal_Bone_Density
G2=Osteopenia
G3=OsteoporosisIs
We will use a one-way ANOVA test to determine if there is a statistically significant difference in mean calcium intake in patients with normal bone density as compared to patients with osteopenia and osteoporosis.
First state the null and alternative hypothesis then write the R code that does the following:
a.) Creates a boxplot for each group and adds the mean to each boxplot and makes G1 boxplot red, makes G2 boxplot blue, and makes G3 boxplot yellow. Also labels the main title as “Calcium intake by group”, the labels the x-axis as "Groups", and the y-axis as "Calcium intake in mg/day".
b.) Performs a one-way ANOVA that compares the means between the groups you are interested in and determines whether any of those means are statistically significantly different from each other with level of significance =.05. Specifically, it tests the null hypothesis that the means of all groups are the same.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ANOVA TEST TEMPLATE
my_data<- data.frame("Groups"=c("put control groups here"),
"Test_results" = c("put test result data here"))
my_data
res.aov <- aov(Test_results ~ Groups, data = my_data)
# Summary of the analysis
summary(res.aov)