dataCollection<-read_csv("Data Collection Mini-Project 3 Coby Ali - Sheet1-2.csv")
My research project was inspired by my desire to construct a diet that gives opportunity for optimal academic performance by virtue of improving brain functionality. Following this, my research question is: Can consuming carbohydrates (100g white bread) before taking a cognitive vigilance test improve brain functionality (in the form of vigilance test score) in men? I specified men in my research question as the curiosity is my own and is meant to be applied to my own life, and I am a man. I also had carbohydrates as the treatment group as I suspected that this macronutrient would be good for brain functionality before I began my research.
The corresponding population parameter of interest for this study is the difference in population proportions of male islanders aged 18+ who an experience an increase in brain functionality either after consuming carbohydrates or fats. This means that we are interested in collecting data which can help us get a value for the population parameter by performing various tests on our sample data and finding if we have statistical evidence to reject the hypothesis that carbohydrates do not a positive and particular effect on brain functionality.
I looked at multiple sources and articles to help inspire this research proposal, one of which was ‘Harris R Lieberman, Nutrition, brain function and cognitive performance’ which has a section which looks both at the physical and mental effects of protein and carbohydrate foods, and also addresses how the literature on this is often contradictory and some researchers disagree with each other and have opposing findings (Lieberman 2003).
A second study, ‘Bellisle F, Blundell JE, Dye L, et al. Functional food science and behaviour and psychological functions’, found that carbohydrates actually led to more drowsiness after a meal than protein did (Bellisle et al., 1998). I then thought that testing the effect of snack sized carbohydrates (100g) rather than full meals would be a helpful experiment, to see if smaller quantities actually had the reverse effect. I will use a random sample of male Islanders in the hope of being able to generalise my results to apply to men in general and I will adhere to validity conditions.
According to the external studies, carbohydrates are better than protein for brain functionality. As this doesn’t reference fats though, the initial conjecture for this study was that there will be no difference between carbs and fats. My suspicion however, was that carbohydrates will also associate with higher brain functionality compared to fats. This was because in my experience I seem to feel more focused after having some carbohydrates before studying. This suspicion also coincides with the alternative hypothesis for this study which is essentially that carbs are better than fats for this purpose.
The observational units were male islanders of ages 18+ living in any town on any of the islands. The variable was measured by prompting the islander to take a vigilance test, then to consume either white bread 100g or cream cheese 100g depending on their group, then take the vigilance test again after an hour of digestion. The second score (time taken) was then subtracted from the initial score, and a positive value would be a success, and a negative or 0 value would be a failure. This is because the research question looks for whether carbohydrates improve the test score, so a value of 0 change means no improvement and is a failure. In terms of things going wrong, it took a lot higher sample size than I expected to satisfy validity conditions for a theory based approach, which is an approach I predict I will be taking at some point in the final project. Getting 10 failures for each group was quite easy but getting 10 successes was harder. Another issue was the islanders ability to refuse to give consent to be part of the study, because then I had to choose another person. The reason this was an issue, is because random sampling took some time for each new participant to be chosen.
First, I used a random wheel of names to decide the neighborhood the participant would be in, then I used a random number generator to decide which house/building they would be in, and then I counted how many males aged 18+ were in the building, and used another random number generator to decide which male to choose, with the lowest number being the male at the top of the list on the screen of the Islands app. Each time I chose a neighborhood from the wheel, I had to change the boundaries of the random number generator to match the amount of buildings in the neighborhood.
If the neighborhood had a building with a name rather than numbers (e.g. Police Station), I would add 1 to the random number generator upper bound. If the first named building was the police Station, and the house before it was number 33, then the Police Station would become number 34. The house after it would have the number 34 on the app, but would require the number 35 from the random number generator to be chosen. So if there was 5 named buildings before house 100 for example, house 100 would require the number 105 to be generated in order to be chosen. This is because the Islands doesn’t consider named buildings in there number system so it just goes house 33 -> Police Station -> house 34.
There are many steps here to choosing someone, so it wasted some time when somebody declined. If somebody did decline, the whole process would start again to find a new person. This satisfies random sampling.
In terms of the response rate, on 30 occasions, a selected person declined to participate in the study. On 2 occasions, the house selected was empty and therefore couldn’t be used. On 15 occasions, The building/house did not have any male adults eligible to participate in the study. On 1 occasion, a place was selected which did not have people but had some kind of plants instead. The total amount of people used in the final data of the study was 170, so the response rate in terms of total people used/ total attempts made at getting a sample was 170/218.
Every time somebody was chosen, they were subjected to another random generator with just the numbers 1 or 2 to decide whether they would be in the treatment or control group. This satisfies random assignment.
Both the explanatory and the response variables for this study were binary-categorical. The explanatory variable was whether the observational unit had consumed carbohydrates, in the form of 100g white bread, or consumed fats in the form of 100g cream cheese. The response variable was whether or not the observational unit experienced an increased level of brain functionality after consuming their assigned food. The obtained responses for the corresponding groups are shown in the two way table below:
tally(Result ~ Group, data = dataCollection, format = "count", margin = TRUE)
## Group
## Result Carbohydrate Fat
## Failure 55 83
## Success 22 10
## Total 77 93
The proportions obtained from the data in the two way table are represented in the side by side bar plots below:
bargraph(~Group, groups = Result, data = dataCollection, auto.key = TRUE, stack = TRUE)
#sample sizes
n.fat<- 93
n.carb<- 77
# counts
success.fat<-10
success.carb<- 22
#sample proportions
p.hat.fat <- success.fat/n.fat
p.hat.carb <- success.carb/n.carb
# difference between the sample proportions of carbs vs fats
p.hat.diff<-p.hat.carb-p.hat.fat
cat("difference in sample proportions of men who experienced brain functionality improvement and consumed carbs or fats is",p.hat.diff)
## difference in sample proportions of men who experienced brain functionality improvement and consumed carbs or fats is 0.1781874
As can be seen, the proportion of successes for the carbohydrate (treatment) group is considerably higher than the proportion of successes for the fat (control) group. This is leading us on the track of the alternative hypothesis which stated that the proportions would come out in this way. We do not have any evidence to make a claim about rejecting the null hypothesis at this stage, though.
The parameter of interest is the difference in population proportions of male islanders aged 18+ who experience an increase in brain functionality either after consuming carbohydrates or fats. Following this, the hypotheses for this research project are as follows:
The null hypothesis is that the proportions of people who experience increased brain functionality are the same in the carbohydrate (treatment) group and the fat (control) group.
\[ H_0:\pi_c-\pi_f=0\]
The alternative hypothesis is that the proportion of people who experience increased brain functionality is greater for the carbohydrate (treatment) group than for the fat (control) group.
\[ H_A:\pi_c-\pi_f>0\] A type I error in this setting would represent the rejection of the null hypothesis (that there is no difference in proportions of the brain functionality improvement between carbohydrate consumers and fat consumers) when it actually shouldn’t be rejected. This would occur if we somehow conducted hypothesis tests and determined that there was evidence against the null hypothesis, when in reality the null hypothesis was true. A type II error in this setting would represent the lack of rejection of the null hypothesis when it actually should be rejected. This would occur if we somehow conducted hypothesis tests and determined that there was no evidence against the null hypothesis, when in reality the null hypothesis was false.
It can be said that the measurements taken in this study can reasonably be considered a representative sample of the population of interest (adult male Islanders) because the study used simple random sampling from all areas of the Islands.
To begin a theory based approach, we will find the appropriate standardized statistic (z-statistic), using R code:
#pooled proportion (total successes/combined sample size)
p.hat.pooled<- (success.carb+success.fat)/(n.carb + n.fat)
# Standard error of the theoretical sampling distribution based on a pooled proportion
SE.diff.null<-sqrt((p.hat.pooled*(1-p.hat.pooled))/n.fat
+ (p.hat.pooled*(1-p.hat.pooled))/n.carb)
# Standardized statistic, z
z <- p.hat.diff/SE.diff.null
cat("standardized statistic z is",round(z,2))
## standardized statistic z is 2.96
This z-statistic is valid if the following validity conditions are met: There are at least 10 successes and 10 failures in each group in the sample. This condition is met with my collected data.
Using the boundaries below, we can determine that this z statistic of 2.96 gives strong evidence against the null hypothesis.
| between - 1.5 and 1.5 | little or no evidence against the null
hypothesis |
| below - 1.5 or above 1.5 | moderate evidence against the null
hypothesis |
| below - 2 or above 2 | strong evidence against the null
hypothesis |
| below - 3 or above 3 | very strong evidence against the null
hypothesis |
The p-value we will calculate to further evaluate the strength of evidence will be a right-sided p-value, as the alternative hypothesis is directional in the sense that it hypothesizes the carbohydrates success proportion to be higher than the fats success proportion.
#Theory-based test p-value
#left.tailed.p.value<-pnorm(z, 0, 1, lower.tail = TRUE)
right.tailed.p.value<-pnorm(z, 0, 1, lower.tail = FALSE)
#right.tailed.p.value
#equivalently:
right.tailed.p.value2<-pnorm(p.hat.diff, 0, SE.diff.null, lower.tail = FALSE)
#right.tailed.p.value2
cat("right-sided p-value is",right.tailed.p.value)
## right-sided p-value is 0.001545626
This p-value of 0.001545626 can be interpreted as the probability of observing the difference in proportions that we saw (0.1781874) assuming that the null hypothesis is true.
Using the boundaries below, we can determine that the right-sided p-value of 0.001545626 gives very strong evidence against the null hypothesis
0.10 < p-value not much evidence against null hypothesis; null is plausible
0.05 < p-value \(\le\) 0.10 moderate evidence against the null hypothesis
0.01 < p-value \(\le\) 0.05 strong evidence against the null hypothesis
p-value \(\le\) 0.01 very strong evidence against the null hypothesis
Given the results of this theory based approach such as the z-statistic of 2.96 and the p-value of 0.001545626, we can conclude that there is overall strong evidence against the null hypothesis and that it has little to no plausibility. This means that we have strong evidence against the hypothesis that the difference in proportions of increased brain development between carbohydrate consumers and fats consumers is 0.
A confidence interval is another test of statistical significance hat can be used.The upper and lower bounds for a 95% confidence interval are given below:
confint(prop.test(c(22,10),c(77,93),correct=F))
These bounds give a 95% confidence interval of [0.0592531, 0.2971217].
This means that we are 95% confident that if we subtract the true population proportion of men who consume fats and experience improved brain functionality, from the true population proportion of men who consume carbohydrates and have an increase in brain functionality, the value obtained would be between 0.0592531 and 0.2971217. As this interval does not contain the null value of 0, we are prompted to once again reject the null hypothesis. The conclusion here based on the confidence interval is the same as the conclusions obtained from the p-value and z-statistic.
Summarize the results of your study (there will be some repetition, and you should cite your evidence). You should tell a story: What did you learn? Did the data behave as you expected? Pay particular attention to whether or not it is reasonable to generalize your sample to the larger population or process. Is there anything you would do differently next time? What similar questions might someone choose to investigate in the future to build on your results?
So to summarize and walk through the process - I first collected my observational units using random sampling, I then conducted my experiments on each unit and ensured that validity conditions for a theory based approach were met after all data points were collected. I then found my values for the p-value and z-statistic and found at least strong evidence against the null hypothesis for both values, then we got evidence against the null hypothesis using the 95% confidence interval. So looking back, the data behaved as I expected it to, I am very happy with how the study turned out and I believe this to be a success. I learned that conducting by-the-book statistical practices from the offset can lead to some interesting and neat results, especially when all validity conditions are adhered to. I also learned that within the Islands app, carbohydrates are generally better for brain functionality than fats among male Islanders aged 18+.
Some critiques and extensions - It would be nice to be able to conduct a study using real people to get results genuinely applicable to human life, but I am aware of the difficulties that can be faced when trying to do that. The sample size could also be increased as that’s almost always a good idea, and I could do random assignment absolutely all the way through to ensure that my analysis is as accurate as possible. I also felt like the vigilance test wasn’t the best method to test brain functionality so maybe I could find something better than that to incorporate into my experiment as well. And for ideas for further development on my research, I think a nice extension would be to test some different macronutrients to see if there are any better than carbohydrates for brain functionality.
Bellisle F, Blundell JE, Dye L, et al. Functional food science and behaviour and psychological functions, British Journal of Nutrition , Volume 80 , Issue S1 , August 1998 , pp. S173 - S193 DOI: https://doi.org/10.1079/BJN19980109
Harris R Lieberman, Nutrition, brain function and cognitive performance, Military Nutrition Division, US Army Research Institute of Environmental Medicine, Volume 40, Issue 3, 1 June 2003, Pages 245-254 https://doi.org/10.1016/S0195-6663(03)00010-2