This report digs into the analysis of math test results from 2006 to 2012, using the dataset titled ‘2006-2012 Math Test Result Citywide Gender’ sourced from Data World. The aim is to understand how student performance in math has evolved over these years. By examining trends over time, this report presents the analysis to identify significant changes in performance using statistical techniques such as linear regression,ANNOVA, t-test among others.
# Load necessary packages
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(ggplot2)
To determine if the trends observed in the data are statistically significant (whether student performance has improved, deteriorated, or remained relatively constant over the years),we perform a linear regression analysis and assess the significance of the slope coefficient
# Filter data for relevant columns
filtered_data <- data %>% select(Year, Grade, Demographic, Mean.Scale.Score)
# Convert Year to a numeric variable
filtered_data$Year <- as.numeric(filtered_data$Year)
# Plot mean scale scores over time for different grades and genders
ggplot(filtered_data, aes(x = Year, y = Mean.Scale.Score, color = Demographic)) +
geom_smooth(method = "lm", se = FALSE) + # Add linear regression trend lines
facet_wrap(~ Grade) + # Separate plots for each grade
labs(title = "Trend Analysis of Mean Scale Scores Over Time",
x = "Year", y = "Mean Scale Score") +
theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'
# Fit linear regression model
model <- lm(Mean.Scale.Score ~ Year + Demographic + Grade, data = filtered_data)
# View model summary
summary(model)
##
## Call:
## lm(formula = Mean.Scale.Score ~ Year + Demographic + Grade, data = filtered_data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -12.2730 -2.9617 0.6684 2.9770 9.2755
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -7652.2423 515.4829 -14.845 < 2e-16 ***
## Year 4.1505 0.2566 16.176 < 2e-16 ***
## DemographicMale -2.5510 1.0263 -2.486 0.014804 *
## Grade4 -3.5000 1.9201 -1.823 0.071690 .
## Grade5 -7.0714 1.9201 -3.683 0.000395 ***
## Grade6 -15.0714 1.9201 -7.849 8.85e-12 ***
## Grade7 -19.8571 1.9201 -10.342 < 2e-16 ***
## Grade8 -22.6429 1.9201 -11.792 < 2e-16 ***
## GradeAll Grades -11.5000 1.9201 -5.989 4.38e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 5.08 on 89 degrees of freedom
## Multiple R-squared: 0.8481, Adjusted R-squared: 0.8345
## F-statistic: 62.13 on 8 and 89 DF, p-value: < 2.2e-16
The coefficient for ‘Year’ (4.1505) suggests that, on average, the Mean Scale Score increases by 4.1505 units for every following year holding other variables constant.
The coefficients for ‘Demographic’ and ‘Grade’ indicate the differences in Mean Scale Score associated with different levels of these categorical variables, compared to their reference levels. For example, being male (Demographic Male) is associated with a decrease of approximately 2.5510 units in Mean Scale Score compared to the reference group (females). Similarly, being in Grade 5, 6, 7, 8, or All Grades, compared to Grade 3 (not listed), is associated with decreases in Mean Scale Score.
The significance of each coefficient is assessed using the p-values. For instance, ‘Year’, ‘Demographic Male’, ‘Grade 5’, ‘Grade 6’, ‘Grade 7’, ‘Grade 8’, and ‘All Grades’ have p-values less than 0.05, indicating statistical significance, while ‘Grade4’ does not, though it’s close at 0.071690.
# Calculate mean scale scores for different demographic groups
mean_scores_demographic <- aggregate(Mean.Scale.Score ~ Grade + Demographic,
data = filtered_data, FUN = mean)
# Box plot to visualize differences in distributions by demographic groups
boxplot(Mean.Scale.Score ~ Demographic, data = filtered_data,
xlab = "Demographic Group", ylab = "Mean Scale Score",
main = "Demographic Differences in Performance")
# Calculate mean scale scores by gender, year, and grade
mean_scores <- aggregate(Mean.Scale.Score ~ Year + Grade + Demographic,
data = filtered_data, FUN = mean)
# Perform a t-test for each year and grade level to determine if the mean scores
# are significantly different between genders for each year and grade level.
t_test_results <- with(filtered_data, t.test(Mean.Scale.Score ~ Demographic))
# Print t-test results
print(t_test_results)
##
## Welch Two Sample t-test
##
## data: Mean.Scale.Score by Demographic
## t = 1.0113, df = 95.639, p-value = 0.3144
## alternative hypothesis: true difference in means between group Female and group Male is not equal to 0
## 95 percent confidence interval:
## -2.456215 7.558255
## sample estimates:
## mean in group Female mean in group Male
## 674.7551 672.2041
The results indicate that the mean test score for female students was estimated at 674.7551, while male students had a mean score of 672.2041. However, the t-test yielded a t-value of 1.0113 with 95.639 degrees of freedom, resulting in a p-value of 0.3144. This suggests that the observed difference in means is not statistically significant at the conventional significance level of 0.05.
Furthermore, the 95 percent confidence interval for the difference in means (-2.456215, 7.558255) includes zero, indicating that we cannot reject the null hypothesis of no difference between the groups. Thus, the evidence does not support a significant disparity in test scores between male and female students based on the given dataset.
# Calculate mean scale scores for each grade level
mean_scores_grade <- aggregate(Mean.Scale.Score ~ Grade, data = filtered_data, FUN = mean)
# Plot mean scale scores for each grade level
plot(mean_scores_grade$Grade, mean_scores_grade$Mean.Scale.Score, type = "l",
xlab = "Grade Level", ylab = "Mean Scale Score", main = "Grade-Level Performance")
## Warning in xy.coords(x, y, xlabel, ylabel, log): NAs introduced by coercion
# Perform ANOVA
anova_result <- aov(Mean.Scale.Score ~ Grade, data = filtered_data)
# Print ANOVA summary
summary(anova_result)
## Df Sum Sq Mean Sq F value Pr(>F)
## Grade 6 5915 985.9 9.742 2.84e-08 ***
## Residuals 91 9209 101.2
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
The ANOVA results indicated a significant effect of grade level on performance (F(6, 91) = 9.742, p < 0.001), suggesting that students’ performance varied across different grades.
##Key Findings:
#Trend Analysis Over Time:
Our analysis revealed a positive trend in math test scores over the years. The linear regression model indicated a significant increase in mean scale scores over time, with an average increase of 4.1505 units per year. However, variations in performance were observed across different grade levels, with certain grades showing lower mean scores compared to others.
#Gender Disparities in Performance:
We investigated gender differences in math test scores using a Welch Two Sample t-test. The results indicated that while there was a numerical difference in mean scores between male and female students, it was not statistically significant. This suggests that there is no substantial disparity in math test performance between genders in the dataset.
#Grade-Level Performance:
An ANOVA analysis revealed significant differences in math test scores across different grade levels. This underscores the importance of considering grade-level variations in educational planning and interventions. Further exploration of grade-level dynamics could provide insights into factors influencing student performance at different stages of education.
#Implications
These findings have implications for educational policy and practice. Understanding the trends and disparities in math test performance can inform targeted interventions to support students’ academic achievement. Moreover, the identification of grade-level and demographic differences highlights the need for tailored approaches to address diverse student needs and promote equitable learning outcomes.
#Disclaimer
This report is based on a specific dataset and time period. While the findings offer insights into math performance trends and disparities during the years 2006 to 2012, it’s important to recognize that the analysis may not fully capture dynamics beyond this timeframe or in datasets with different characteristics. Caution should be exercised when generalizing the results to broader contexts, and further research incorporating additional data sources and time periods may be warranted to validate and extend the findings presented in this report.