STAT_data<-
  read_csv("~/Statdata project - recommended format.csv")
head(STAT_data, 2)

Introduction

This project was asking the question. Is there a significant difference in mean attention spans between napping and non-napping individuals on the islands? For this experiment the population parameter of interest was the difference in attention span between individuals who nap and those who don’t. I anticipating a potentially higher average attention span among individuals who nap due to perceived cognitive benefits associated with napping. During my literature review I found that there are many benefits of not only getting a full nights sleep but also taking naps in the day. These are the main two that helped me come up with the question for this exsperiment. The first is a book on the broader science of out sleep and the health benefits we gain from it. The second citation was a study done to test if after learning something participants did better when napping for 27min or taking a break for 27min or cramming that information for 30min. They were tested 30 min and 1 week after learning. When tested 30 min after learning, the cramming and napping led to significantly better memory than taking a break. After a week, napping maintained this significant advantage, but cramming did not. I drew inspiration from this as I wanted to test after just 15 min nap did people do better then no nap. Additional this made me go in to the project with the suspect that the parameter value of attention span of those who nap would be higher then those who don’t.

Walker, Matthew. Why We Sleep. Harlow, England: Penguin Books, 2018.

Cousins, James N., Kian F. Wong, Bindiya L. Raghunath, Carol Look, and Michael W. L. Chee. “The Long-Term Memory Benefits of a Daytime Nap Compared with Cramming.” Sleep 42, no. 1 (January 1, 2019): zsy207. https://doi.org/10.1093/sleep/zsy207.

Data Collection Methods

This studies protocol was as follows. The Observational Units: Were individuals living on three different islands: Irond-bard, Providence, and Bonne Sante. They were various individuals from diverse backgrounds and age groups as I wanted to get a broad range of participants. The youngest being 12 and the oldest 112 the mean age of my participants was 43. The actual process started by first rolling a random generator for 1 of the 3 islands, 1 for Irondbard, 2 for Providence, and 3 for Bonne Sante. Within each island, there were multiple villages and stations. I assigned a number from 1 to the total number of locations (villages and stations) on that island, ensuring each location had an equal chance of selection. As an example if the random number landed on a village, such as Shinobi in Providence. Shinobi for instance, had a population of 842 with various houses, each holding different amounts of people. So I would then scroll down to check the total number of houses in that village. Then used a random number generator to select one through the total number of houses and select a house. Within the chosen house, I then employed a random number generator, ranging from 1 to the number of occupants in that house. If it landed on, say, house 362, I’d approach the household consisting of two individuals living there. I’d then again use a random number generator 1 through the total amount of residents thus randomly selecting one of them and then invite them to the study. If they agreed I did random number generator again assigning them into the napping and non-napping group. If they declined I simply randomly generated another number for the individuals in the household and ask them instead. In the case all individuals in the family decline I will walk back a step and re-select a new random house in that same village.

After getting their participation in the study I would tell them to take an attention test and depending on which group they were in the napping or non napping they would after finishing take a 15 minute nap and then another attention test or just not have the nap and take another attention test right after. I would log there attention test scores in the excel sheet as soon ad they were done with the tests and tried to limit the amount of time between tasks.

There was only 2 really minor logistical issues one was that one of my participants who was 42 died after taking the tests. Additional its coded in that the islanders will go to sleep after 5pm mostly so there was a point were I realized this having collected some data the people I had started to randomly select would be asleep and so I had to wait till tomorrow to get there consent to participate in the study.

Looking back some potential sampling/data errors was that after finishing their first attention test I should have made the non napping group wait 15 minutes before taking the second attention test so that the same amount of time can elapse for both groups. As it was not including that may have led to some bias in the data. In terms of actual errors there was non as I never messed up giving them the attention test and then a different length nap. For the response rate, as stated above I would simply randomly get another member of that house or a new house I only had 3 people refuse to participate and 2 were all from one house the other was a minor so out of 49/52 =0.942307692. So I had a good response rate of 94%. Insistently, I didn’t have to do repeated visits as I would have a separate tab for each participant and I did them in groups at a time, each on there own tab so they were individuals but I was able to make them all take the test then nap or not and then take another and scored there test scores as I went. The only sampling mistake, simply proved to be a waist of time as I collected a lot more information on the participants then I needed to. I originally wrote down their Name, Age, Gender, Location (Village on the island they lived in), onto of the group they were in and their attention test scores. This was later fixed as I only needed the difference of their two attention scores and there group variable.

histogram(~ChangedAS, data = STAT_data)

The histogram above is simply graphing all subjects change in attention score both napping and non napping group so you can see its relatively normal to slightly skewed right. Though keep in mind that this is their base score minus there second attention test test score. As stated before there was two variables. The quantitative variable for attention score. It was the difference between the individuals two test scores. And the binary categorical response variable which was a yes or no telling if they were in the napping group or not. To carry out a test of significance and a confidence interval we must first define the population and parameter. In this experiment the population are a random sample of those living on all the islands, the youngest participants being 12 and oldest 115. Moreover, the parameter is the difference in mean attention span between individuals who nap and those who don’t. To do a test we must also have a null and alternative hypothesis. In this case the null hypothesis proposes that there is no difference in the mean attention spans between the group that naps and the group that does not nap. The alternative hypothesis suggests that there is a difference in the mean attention spans between the group that naps and the group that does not nap.

\[H_{o}: \mu_{napping} = \mu_{non-napping}\]

\[H_{A}: \mu_{ napping} \neq \mu_{non-napping}\] There is the risk of a type I or type II error. A type I error (False Positive): This would occur if I rejected the null hypothesis when it’s actually true. In my study, a Type I error would mean concluding that there is a significant difference in attention spans between napping and non-napping groups when, in reality, there isn’t any difference. A type II error (False Negative): This would occur if we fail to reject the null hypothesis when it’s actually false. In my study, a Type II error would mean concluding that there’s no significant difference in attention spans between napping and non-napping groups when, in fact, there is a difference.

Before I discus my measurements and findings I need to preface that they are a representative sample from the islanders(the populations of interest). I made sure to have more then 20 subjects in both categories and made sure it was both a random sample and random assignment. Included a wide variety of ages to make it as general to all the islanders as possible and each subject was tested individually to limit bias. So I believe this can be considered a representative sample for all those people living on the islands.

favstats(ChangedAS ~ NapStatus, data = STAT_data)

In this case the means between the two groups indicate a strong difference. With the mean of the napping group being (4.0833) and we can subtract the mean of the non napping group (-1) to get the difference of (5.083). Additional you can look at the box plot bellow and see the clear difference between the groups improvement. As the median and the mean for the napping group is clearly above the non napping group. However, the standard deviation is also higher for the napping group meaning there was some higher extremes as we can see with the min and max of the napping group being -8 & 18 whereas the non napping groups extremes only being -6 & 4.

bwplot(NapStatus ~ ChangedAS, horizontal = TRUE, data = STAT_data)

stat(t.test(ChangedAS ~ NapStatus, data = STAT_data))
##         t 
## -3.555745
pval(t.test(ChangedAS ~ NapStatus, data = STAT_data))
##    p.value 
## 0.00118865

The appropriate standardized statistic in this case is the test statistics. As its the most appropriate standardized statistic with the two variables at play. However, to use this statistic its validity conditions must be met. In this case the validity conditions were met with the 20 subjects in both categories and distribution of the box plot being roughly normal and not skewed and each observation was independent from each other. Because it passes all the validity conditions we can use this test, in doing so it returned a test statistic of 3.555745. To further strengthen our test data we need to run the p-value test and the validity conditions of the sampling methods being a random sample and random assignment to include a diverse participant range and minimum bias and having at least 20 in both groups checks out. So using the definition of the p-value: which is the probability of observing a test statistic that is as extreme or more extreme than currently observed test statistic(3.555745), the p-value = 0.00118865. In this case the p-value is extremely small, especially compared to the significance level of 0.05. This indicated that its extremely unlikely that the t-statistic value we received (3.555745) is by random chance. The p-value thus suggested strong evidence against the null hypothesis, indicating a significant difference between groups mean attention spans. Thus our conclusion using the p-value is that we have strong evidence to reject the null hypothesis.

confint(t.test(ChangedAS ~ NapStatus, data = STAT_data))

The next step in the study is to run a confidence interval test. The confidence interval tells you more than just the possible range around the estimate. It also tells you about how stable the estimate is. Using R the confidence interval for this case is between (2.172 to 7.994) and this does not include zero. This implies that, with 95% confidence we can say the difference in mean attention spans between the napping and non-napping groups is statistically significant and is unlikely to be zero. Comparing this to the conclusion drawn earlier (from the hypothesis test), where the p-value was extremely small (0.00119), both conclusions align. The p-value suggested strong evidence against the null hypothesis, indicating a significant difference between group attention spans. Similarly, the confidence interval does not include zero, reinforcing the same conclusion—that there is indeed a statistically significant difference in attention spans between the napping and non-napping islanders.

Conclusion:

The study’s results, supported by a substantial t-statistic (3.555745), an exceptionally small p-value (0.00118865), and a confidence interval (2.172 to 7.994) excluding zero, provides very strong evidence to reject the null hypothesis. This confirms a significant difference in attention spans between individuals who nap and those who don’t, aligning with the initial hypothesis drawn from the literature review, highlighting the cognitive benefits associated with napping.

The methodology, involving a sizable and diverse random sample with random assignments, which allows for reasonable generalization of findings to the broader population of the islands. However, a larger sample size and more experiments could enhance the depth of this generalization.

For future investigations, refining the study’s methods to ensure equal elapsed time for both napping and non-napping groups between attention tests would help improve accuracy. Further exploration into the duration of post-nap cognitive benefits at intervals (e.g., 30 minutes, 1 hour, 1.5 hours) and examining varied nap lengths (beyond the 15-minute duration used) could shed light on sustained cognitive enhancement and optimize cognitive function.These potential studies would significantly contribute to understanding the lasting effects of napping and how different nap durations influence cognitive performance, offering valuable insights for improving cognitive function.

Bibliography: references to literature mentioned in the introduction

Walker, Matthew. Why We Sleep. Harlow, England: Penguin Books, 2018.

This is a book more about the science of why and how we sleep and goes into the many cognitive benefits of gettign a full nights sleep and how sleep helps the brain.

Fang, S-C, Huang, C-J, Wu, Y-L, Wu, P-Y, Tsai, P-S. Effects of napping on cognitive function modulation in elderly adults with a morning chronotype: A nationwide survey. J Sleep Res. 2019; 28:e12724. https://doi-org.ezproxy.whitman.edu/10.1111/jsr.12724

This study though was done on older adults found that elderly patients with nap duration greater then 60 min exhibited significantly higher scores then non-nappers. Confirming that in the morning type elderly nappers greater then 60 min are associated with less cognitive decline. Though it couldn’t find an association with evening type or intermediate type early napping adults. However I still thought it was interesting and tolled me there the could be a correlation between better cognitive function and napping.

Cousins, James N., Kian F. Wong, Bindiya L. Raghunath, Carol Look, and Michael W. L. Chee. “The Long-Term Memory Benefits of a Daytime Nap Compared with Cramming.” Sleep 42, no. 1 (January 1, 2019): zsy207. https://doi.org/10.1093/sleep/zsy207.

This citation was a study done to test if after learning something participants did better when napping for 27min or taking a break for 27min or cramming that information for 30min. They were tested 30 min and 1 week after learning. When tested 30 min after learning, the cramming and napping led to significantly better memory than taking a break. After a week, napping maintained this significant advantage, but cramming did not. I drew inspiration from this as I wanted to test after just 15 min nap did people do better then no nap.

https://rpubs.com/BeaWhitman3432/1129876