This is the summary of the dataset in R Code.
summary(sleep)
## extra group ID ## Min. :-1.600 1:10 1 :2 ## 1st Qu.:-0.025 2:10 2 :2 ## Median : 0.950 3 :2 ## Mean : 1.540 4 :2 ## 3rd Qu.: 3.400 5 :2 ## Max. : 5.500 6 :2 ## (Other):8
This is the summary of the dataset in R Code.
summary(sleep)
## extra group ID ## Min. :-1.600 1:10 1 :2 ## 1st Qu.:-0.025 2:10 2 :2 ## Median : 0.950 3 :2 ## Mean : 1.540 4 :2 ## 3rd Qu.: 3.400 5 :2 ## Max. : 5.500 6 :2 ## (Other):8
The dataset used is the “sleep” dataset provided by RStudio. The data shows the effect of two soporific drugs (increase in hours of sleep compared to control) on 10 patients.
Variables:
‘extra’: increase in hours of sleep
‘group’: drug given
‘ID’: patient ID
The dataset contains 20 observations of 3 variables.
This box plot compares the extra sleep induced by two different drugs (group) given to the 10 patients. As you can see, the second group has a more of an increase in extra sleep than the first group.
This scatter plot shows the relationship between the patient ID and extra sleep. The colors represent which group/drug was given. The size shows the magnitude of extra sleep.
This 3D Graph Line Plot represents of how extra sleep vary across the patient ID and groups.
The Bar Chart shows the average extra sleep for each drug given represented by the group variable. This plot shows a good comparison of both drugs given to the patients.
In this proportion of the presentation I did an t-test to evaluate if there is a big difference in extra sleep between the two groups of 10 patients. As you can see the p-val is greater than 0.05, so we fail to reject the null hypothesis. This means there is not enough evidence to conclude the drugs have any big difference in the effects of sleeping. It can also be said that since the p-value is close to 0.05, a larger sample size may show if there is a difference in the effects of sleeping.
## ## Welch Two Sample t-test ## ## data: extra by group ## t = -1.8608, df = 17.776, p-value = 0.07939 ## alternative hypothesis: true difference in means between group 1 and group 2 is not equal to 0 ## 95 percent confidence interval: ## -3.3654832 0.2054832 ## sample estimates: ## mean in group 1 mean in group 2 ## 0.75 2.33