VitaminD <- read_csv("~/Downloads/Vitamin-D.csv")

We are frequently told that vitamin D, or sunlight, is good for us. Children are often asked to play outside, and many people engage in sunbathing. However, I wanted to know if vitamin D is so important for us that it affects sleep health. In this project, I ask “Does receiving more vitamin D in the form of sunlight improve sleep quality?”. I attempted to answer this question by designing an experiment using the Islanders program created by the Queen Mary University of London. In this experiment, the islanders were placed into two groups: a sunbathing and resting group. The population parameter for this study is the mean sleep score of the sunbathers minus the mean sleep score of the resters. I chose to conduct the study in this manner to see if there was any difference between the two means. I believed there would be, because I had done previous research on the subject by way of studies. Many studies relate the effects of sunlight, or vitamin D in pure form, to sleep quality and length. For example, a study done by the Brazilian Sleep Association found that pregnant women, when given more vitamin D, do tend to sleep better. Another study by BioMed Research International found that vitamin D depletion in hemo-dialysis patients resulted in decreased sleep quality. Because of these studies and many more, I suspected that the actual parameter value of \(\mu_{sunbathing}-\mu_{resting}\) would be relatively high, or at least greater than zero.

The study design was experimental in nature. For experimental units, I used 200 adult islanders, randomly selected from across the islands. They were randomly selected in this manner: First, I chose two villages on each of the three islands, so there were six villages total. For each village, I chose about 33 islanders. I chose them by putting the number of houses in that village into a random number generator, generating 33 numbers, and clicking on those 33 houses. I chose the first adult name that popped up for the house, and I believe this gave me an even mix of men and women, as well as an even mix of ages. Through the six random villages across the three islands, I gathered 200 experimental units. Each experimental unit was assigned to either group 1 or 2 using random assignment with a random number generator. Group 1 was then asked to sit still for 30 minutes, while group 2 was asked to sunbathe for 30 minutes. Immediately after the 30 minute period, both groups were asked to take a 30 minute nap. Immediately after this 30 minute nap, all 200 experimental units were asked to fill out a survey consisting of a single question: “On a scale of 1 to 10, how energetic do you feel right now?” Their responses were gathered, and these responses because the quantitative response variable. Several things went wrong during the course of the study. To begin with, one subject died shortly after I had gathered all the subjects, but before I had started the study. He had to be replaced with another random islander. Next, many islanders refused to participate in the study, which made the random sampling take longer. Finally, the survey question about energy levels had to be asked immediately after the nap. For a couple of islanders, I did not manage to ask them in the minutes after their nap, and asked them later. This resulted in some outlying low values on the 10 point scale, like 3 and 4. These values occurred because I asked the islanders how energized they felt about an hour after their nap, and they did not feel as energized as the islanders who had just woken up from their nap. Timing was very important in this study. From the beginning of the actual study to the end, each islander took about 1 hour and 30 seconds. 30 minutes were given for their rest (in sunlight or not), 30 minutes were given for their nap, and 30 seconds were given to fill out the survey. I visited each islander 5 times: Once to choose them for the study, once to make them rest, once to make them nap, once to make them take the survey, and once to gather their survey response. I utilized both random sampling and random assignment in this study, so there should be relatively few sampling errors. Some errors that may occur are due to the non-random manner in which I chose the villages, and the non-random manner in which I chose the member of each household that would participate in the study.

My explanatory variable is a binary categorical variable with two categories: whether or not the subject sunbathed for 30 minutes before napping, or sat still for 30 minutes before napping. This variable was relatively easy to measure, since I only had to use a random number generator to assign each subject to a group, and then have them perform the task assigned to their group. My response variable was their energy level after napping, which I measured as a quantitative variable. I changed the response variable from categorical to quantitative, because simply asking the islanders how well they slept did not yield measurable data. I chose to work with these variables because I wanted to know how sunlight affected sleep quality. In many of my reference studies, the researchers exposed the subjects to sunlight and measured their sleep quality. Unfortunately, the island does not allow measured sleep quality, so I have decided to use a survey question: “On a scale of one to ten, how energetic do you feel right now?” This question, asked of the islanders immediately after they awake from their nap, gauges the effectiveness of the nap; i.e. how much energy they have after the nap. This is a proxy variable. Since I cannot measure the quality of sleep, I am measuring the energy level after sleep as a proxy variable. The data gained from these two variables are shown below in a side-by-side boxplot.

bwplot(Group ~ Sleep, horizontal = TRUE, data = VitaminD)

As shown by the box plot, there is not a great disparity between the two groups. As shown by the five-number summary and the box plot, the medians are identical. The resting group does seem to have a wider range of sleep scores, but this could be due to a far outlier. The sunbathing group has several outliers, but has a smaller spread from quartile 2 to quartile 4. From this boxplot, there does not appear to be a strong association between the variables, but some summarizing statistics may provide more information.

favstats(Sleep ~ Group, data = VitaminD)

The two means are very close, differing by only about .03 data points. The mean of the resting group is 8.479798, and the mean of the sunbathing group is 8.445545. The standard deviation of the resting group is 1.351339, while the standard deviation of the sunbathing group is 1.442049, which is to be expected with the outliers. The standard deviations don’t differ very much, either. This data is not very skewed.

After gathering some preliminary information about the data, it is time to conduct a test of significance, complete with a confidence interval. Our population is the population of Islanders, and our population parameter is the mean sleep score of resters subtracted from the mean sleep score of sunbathers. This is a quantitative parameter, using the symbol \(\mu\). Therefore, we will use a t-test, for the quantitative parameter.

In this test, there are certain validity conditions that must be met. First of all, we must have a sample larger than 20 in each cell of a table. We have a sample of 200, which is evenly distributed, so that condition is met. Additionally, we need the sample distribution to not be strongly skewed. As shown by the histograms below, neither sample group is too strongly skewed. They are both a little skewed to the left, but not enough to affect the results of the test.

histogram(~ Sleep | Group, data = VitaminD, width = 1)

Our null hypothesis is that there is no difference between the mean sleep scores of the two groups, or that \(\mu_{sunbathing}-\mu_{resting}=0\). Our alternative hypothesis, however, is that \(\mu_{sunbathing}-\mu_{resting}\neq0\),(or that there IS a difference between the mean sleep scores of the two groups) because we aren’t sure which way vitamin D will affect sleep health. Therefore, we will use a two-tailed t-test as our test of significance. Below is the two-tailed t-test, as well as the accompanying confidence interval.

t.test(Sleep ~ Group, data = VitaminD)
## 
##  Welch Two Sample t-test
## 
## data:  Sleep by Group
## t = 0.17337, df = 197.6, p-value = 0.8625
## alternative hypothesis: true difference in means between group Rest and group Sunbathe is not equal to 0
## 95 percent confidence interval:
##  -0.3553673  0.4238742
## sample estimates:
##     mean in group Rest mean in group Sunbathe 
##               8.479798               8.445545

Here, we can see that our t-statistic is t=0.17337. This is very low, which provides us with very weak evidence against the null hypothesis. Our p-value echoes this weakness, with a p-value of 0.8625, which means the probability of finding values as extreme or more extreme than our sample mean is .8625 assuming the null distribution is true. This provides very weak evidence against the null. Our 95% confidence interval is -0.3553673 to 0.4238742, meaning we are 95% confidence that the true difference in means of the two groups lies between -0.3553673 and 0.4238742. This confidence interval includes 0 in a very wide margin, meaning 0 is quite possibly the difference in means. Again, this provides very weak evidence against the null hypothesis.

In this instance, a type I error would be rejecting the null hypothesis, which states that there is no difference between the mean sleep scores of the two groups, when the null hypothesis is actually true, and there really IS no difference. A type II error would result in failing to reject the null hypothesis when it really the null hypothesis is false, and there really IS a difference between the two groups.

I believe these errors will be unlikely in this instance, however, because of our large sample size. There are 200 islanders in this study, which, due to random sampling, is an accurate and representative sample of the island population.

To conclude, based on the evidence provided by the p-value, the t-statistic, and the confidence interval, we fail to reject the null hypothesis. We fail to reject the idea that there is no association between vitamin D and sleep quality.

This was a very useful study for me. I learned that in the context of the Islands, it is likely that there is no association between sunbathing and sleep quality. This can be generalized to the Islands as a whole, but not to a human population. The Islands may not have the programming to encompass such an experiment. The data from these islanders did not behave as expected, because I really thought there would be more of an association. Perhaps other questions or experiments would yield a more statistically significant result, such as exposing the islanders to sunlight for a greater length of time, or seeing whether gender has an effect on reception to Vitamin D. I believe a longer-running study with more sunlight-sleep cycles would have yielded a better result. Overall, this study has shown that for the islanders, there is not a significant association between vitamin D and sleep quality.

Bibliography:

de Menezes-Junior, L. A. A., Sabiao, T. da S., de Moura, S. S., Batista, A. P., de Menezes, M. C., Carraro, J. C. C., Andrade, A. C. de S., Machado-Coelho, G. L. L., & Meireles, A. L. (2023). Influence of sunlight on the association between 25-hydroxyvitamin D levels and sleep quality in Brazilian adults: A population-based study. Nutrition (Burbank, Los Angeles County, Calif.), Volume 110, 2023, ISSN 112008–112008. (https://doi.org/10.1016/j.nut.2023.112008)

Dias, C. J., Barroso, R., Dias-Filho, C. A. A., Ferreira, A. C., Cabido, C. E. T., Crestani, C. C., Silva, M. S., Pinheiro, A. N., Rodrigues, B., & Mostarda, C. T. (2022). Possible influences of vitamin D levels on sleep quality, depression, anxiety and physiological stress in patients with chronic obstructive pulmonary disease: a case control study. Sleep Science (Sao Paulo, SP ), Volume 15(Spec 2), 2022, Pages 369–374. (https://doi.org/10.5935/1984-0063.20210019)

Hejazian, S. M., Ahmadian, E., Zununi Vahed, S., Faraji Gogani, L., & Farnood, F. (2021). The Association of Sleep Quality and Vitamin D Levels in Hemodialysis Patients. BioMed Research International, 2021, ISSN 4612091–4612097. (https://doi.org/10.1155/2021/4612091)

Mason, C., De Dieu Tapsoba, J., Duggan, C., Imayama, I., Wang, C.-Y., Korde, L., & McTiernan, A. (2016). Repletion of vitamin D associated with deterioration of sleep quality among postmenopausal women. Preventive Medicine, Volume 93, 2016, Pages 166–170. (https://doi.org/10.1016/j.ypmed.2016.09.035)