##Introduction
Research question: How does a student’s high school GPA, reading SAT score, and math SAT score predict their first year college GPA?
The dataset is “satgpa” and has 1000 observations and 6 variables, with each observation representing a student. The variables are the student’s sex, the verbal SAT percentile (sat_v), the math SAT percentile (sat_m), the combined SAT percentile (sat_sum), high school GPA (hs_gpa), and their first year GPA (fy_gpa). The variables I will focus on are the hs_gpa, sat_v, and sat_m as the predictors, and the fy_gpa as the outcome. I got this dataset from OpenIntro.org through the datasets folder in blackboard. The link is https://www.openintro.org/data/index.php?data=satgpa
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)
library(car)
## Loading required package: carData
##
## Attaching package: 'car'
## The following object is masked from 'package:dplyr':
##
## recode
satgpa <- read.csv("satgpa.csv")
##Data Analysis
To prepare the data for a regression analysis, I will clean the dataet by looking for missing values and review a summary of the relevant variables being used, and also look into the distributions of the relevant variables. I will make some visualizations to look at fy_gpa and its relationship to hs_gpa, sat_v, and sat_m respectively.
dim(satgpa)
## [1] 1000 6
summary(satgpa)
## sex sat_v sat_m sat_sum hs_gpa
## Min. :1.000 Min. :24.00 Min. :29.0 Min. : 53.0 Min. :1.800
## 1st Qu.:1.000 1st Qu.:43.00 1st Qu.:49.0 1st Qu.: 93.0 1st Qu.:2.800
## Median :1.000 Median :49.00 Median :55.0 Median :103.0 Median :3.200
## Mean :1.484 Mean :48.93 Mean :54.4 Mean :103.3 Mean :3.198
## 3rd Qu.:2.000 3rd Qu.:54.00 3rd Qu.:60.0 3rd Qu.:113.0 3rd Qu.:3.700
## Max. :2.000 Max. :76.00 Max. :77.0 Max. :144.0 Max. :4.500
## fy_gpa
## Min. :0.000
## 1st Qu.:1.980
## Median :2.465
## Mean :2.468
## 3rd Qu.:3.020
## Max. :4.000
colSums(is.na(satgpa))
## sex sat_v sat_m sat_sum hs_gpa fy_gpa
## 0 0 0 0 0 0
This dataset has 1000 observations, 6 variables, and no missing values.
satgpa_analysis <- satgpa |>
select( fy_gpa, sat_v, sat_m, hs_gpa) |>
filter(!is.na(fy_gpa), !is.na(hs_gpa), !is.na(sat_v), !is.na(sat_m))
satgpa_analysis |> summarise(
mean_fy_gpa = mean(fy_gpa),
mean_hs_gpa = mean(hs_gpa),
mean_sat_v = mean(sat_v),
mean_sat_m = mean(sat_m)
)
## mean_fy_gpa mean_hs_gpa mean_sat_v mean_sat_m
## 1 2.46795 3.1981 48.934 54.395
Here we used 3 dplyr functions: select, filter, and summarise.
ggplot(satgpa_analysis, aes( x = hs_gpa, y = fy_gpa )) +
geom_point() +
geom_smooth(method = "lm") +
labs(x = "High Schoo; GPA", y = "First-Year College GPA")
## `geom_smooth()` using formula = 'y ~ x'
ggplot(satgpa_analysis, aes( x = sat_v, y = fy_gpa)) +
geom_point() +
geom_smooth(method = "lm") +
labs(x = "Verbal SAT percentile", y = "First-Year GPA")
## `geom_smooth()` using formula = 'y ~ x'
ggplot(satgpa_analysis, aes( x = sat_m, y = fy_gpa)) +
geom_point() +
geom_smooth(method = "lm") +
labs(x = "Math SAT percentile", y = "First-Year GPA")
## `geom_smooth()` using formula = 'y ~ x'
Looking at the 3 scatterplot, we can see a roughly similar shape between the bodies, with each variable having a positive correlation with the first-year college GPA.
##Regression Analysis
Model:
gpa_model <- lm(fy_gpa ~ hs_gpa + sat_v + sat_m,
data = satgpa_analysis)
confint(gpa_model)
## 2.5 % 97.5 %
## (Intercept) -1.159712442 -0.57414080
## hs_gpa 0.504589788 0.65554677
## sat_v 0.011261812 0.02165580
## sat_m 0.007293219 0.01750189
summary(gpa_model)
##
## Call:
## lm(formula = fy_gpa ~ hs_gpa + sat_v + sat_m, data = satgpa_analysis)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.10154 -0.35893 0.02541 0.41321 1.61394
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.866927 0.149202 -5.810 8.38e-09 ***
## hs_gpa 0.580068 0.038463 15.081 < 2e-16 ***
## sat_v 0.016459 0.002648 6.215 7.55e-10 ***
## sat_m 0.012398 0.002601 4.766 2.16e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.5942 on 996 degrees of freedom
## Multiple R-squared: 0.3586, Adjusted R-squared: 0.3567
## F-statistic: 185.6 on 3 and 996 DF, p-value: < 2.2e-16
I used a multiple linear regression model to examine whether highschool GPA, verbal SAT percentile, and math SAT percentile could predict the first-year college GPA. Looking at the coefficients, the all three predictors had positive relationships with first-year college GPA. A one-point increase in highschool GPA was associated with around a 0.580-point increase in first-year college GPA. A one-point increase in verbal SAT percentile was was associated with around a 0.016-point increase in first-year college GPA, while a one-point increase in math SAT percentile was associated with an estimated 0.012-point increase in first-year college GPA. These results show suggest a higher verbal and math SAT percentile, and a higher highschool GPA tended to have higher first-year college GPAs.
##Assumptions and Diagnostics
plot(gpa_model, which = 1)
plot(gpa_model, which = 2)
plot(gpa_model, which = 3)
plot(gpa_model, which = 5)
vif(gpa_model)
## hs_gpa sat_v sat_m
## 1.228188 1.345559 1.367062
For the main assumptions: 1. Linearity: In residuals vs fitted, the red line sits mostly straight on the horizontal zero, and the points mostly random with an even amount of points above and below the 0 line. 2. Independance: The observtions will be treated as independant since all 1000 of the observations are each a different student with distinct scores, making it almost entirely independant. 3. Homoscedasticity: Each section of the graph as an even spread, with no sections having a distinct bottleneck look to them, so the variance is good. 4. Normality of residuals: The points follow a clear diagonal line throughout the Normal Q-Q, so this assumption is met. 5. Multicollinearity: In the VIF, each variable has a score very close to 0 and is great since the model has 2 sat scores as predictors.
##Conclusion
The regression model found that highschool GPA, verbal SAT percentiles, and math SAT percentiles all can result in higher first-year college GPA for students. Each predictor variable had a positive increase as the first-year college GPA went up. As for model fit, the multiple R-squared was 0.3586 and the adjusted R-squared was 0.3567, so the variables accounted for almost 36% of the variation in first-year college GPA, and the other 64% was from other random variables. This research could be used for research on how highschool grades translate to college grades, and help give insight on how important a highschooler’s grades are in predicting college success. Some things I would add are variables involving location (state, city, school name) and possibly looking at average scores in individual schools.