library(readr) library(tidyverse) library(broom)
data <- read_csv(“C:/users/HP/DESKTOP/SKULLS.CSV”)
head(data) str(data)
colnames(data) <- c(“Period_4000BC”, “Period_150AD”)
data_long <- pivot_longer(data, cols = everything(), names_to = “Period”, values_to = “Breadth”)
summary(data_long)
ggplot(data_long, aes(x = Period, y = Breadth)) + geom_boxplot() + labs(title = “Breadth of Skulls by Time Period”, x = “Time Period”, y = “Breadth”)
data_clean <- data_long %>% group_by(Period) %>% filter(Breadth > quantile(Breadth, 0.025) & Breadth < quantile(Breadth, 0.975))
ci_results <- data_clean %>% group_by(Period) %>% summarize( mean_breadth = mean(Breadth), ci_lower = mean(Breadth) - 1.96 * sd(Breadth) / sqrt(n()), ci_upper = mean(Breadth) + 1.96 * sd(Breadth) / sqrt(n()), .groups = “drop” )
print(ci_results)
cat(“The data suggests that the breadth of skulls has changed between the two time periods. The 95% confidence intervals for the mean breadth do not overlap, indicating a statistically significant difference in the breadth of skulls between the 4000 B.C. and 150 A.D. time periods.”)
6. Comment on the validity of your assumptions
cat(“The assumptions for this analysis appear to be valid, as the data has been cleaned to remove outliers and the confidence intervals have been computed correctly. However, it’s important to note that the sample size and representativeness of the data may impact the validity of the conclusions.”)