The data set we are using for the case study, College Data, can be found on Kaggle. The data has 777 observations and 18 variables.
There are 18 variables in the data set.
Private: Factor with yes or no indicating private or public university
Apps: Number of applications the school received
Accept: Number of students accepted
Enroll: Number of new students who enrolled
Top10perc: New students in top 10% of their high school class
Top25perc: New students in top 25% of their high school class
F.undergrad: Number of full time undergraduates
P.undergrad: Number of part time undergraduates
Outstate: out of state tuition
Room.Board: Cost of room and board
Books: Estimated cost of books
Personal: Estimates personal spending
PhD: Percent of faculty with a PhD
Terminal: Percent of faculty with terminal degree
S.F.Ratio: Student faculty ratio
Perc.alumni: Percent of alumni who donate
Expend: Instructional expenditure per student
Grad.Rate: Graduation rate
The objective of the case study is to identify the criteria necessary to get into a private college.
I load the data from R library(mlbench) in the following code. I delete all colleges with missing values and keep only the colleges with complete records for the case study. The final analytic data has 777 colleges.
We are going to look at the association between private College and acceptance
FALSE [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1
FALSE [38] 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1
FALSE [75] 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1
FALSE [112] 1 0 1 1 1 1 1 0 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 1
FALSE [149] 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 0 0 1 1 0 0 1 1 1
FALSE [186] 1 1 1 1 1 1 1 0 1 1 0 1 0 1 1 1 0 1 0 1 1 0 0 1 1 1 1 1 1 1 1 1 1 0 1 1 1
FALSE [223] 0 0 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
FALSE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1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 1 0 0
FALSE [741] 1 0 1 0 1 0 0 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 0 1 1 1 1
The Acceptance histogram is highly skewed to the right. We see that the
acceptance is extremely high between 0-2500 and drastically drops after
that. The acceptance continues to decrease until it reaches zero around
15000.
A pairwise scatter plot is used to identify any potential issues with the predictor variables. The final analytic model has 777 observations and 19 variables. Showing none of the predictors had any issues.
The pairwise scatter plot shows many patterns in the predictor variables.
All Predictor variables are unimodal. We see that Apps and Accept are significantly skewed to the right. Therefore we take a closer look at the two variables.
After Exploratory analysis, we decided to regroup Accept and App, we then defined dummy variables for the associated variables. The new variables will be used in the model during the search process.
A moderate correlations is observed between: Apps vs Accept, Top10perc vs Top25perc, Apps vs Enroll,Enroll Vs F.Undergrad, and Accept vs Enroll. None of the variables will be dropped as an automatic variable selection process will occur. The variable selection will remove potential redundant variables since some of them will be forced into the final model.
Our goal of the report is an association analysis between a set of criteria for a private colleges. Therefore we do not preform variable transformations yet.
Looking at the data set we know in a real world situation many of the variables are important. However when doing a statistical analysis those variables may not be statistically significant. Regardless of the statistical significance the variables will be included. In the college study Acceptance, Enroll,Top10perc, and Apps are considered significant risk factors. These variables will be included in the final model.
Based on the exploratory analysis we are building the full model and reduced model.
| Estimate | Std. Error | z value | Pr(>|z|) | |
|---|---|---|---|---|
| (Intercept) | -2.1637 | 1.0377 | -2.0850 | 0.0371 |
| Enroll | 0.0012 | 0.0008 | 1.5712 | 0.1161 |
| Top25perc | -0.0080 | 0.0167 | -0.4822 | 0.6297 |
| Accept | 0.0002 | 0.0004 | 0.5726 | 0.5669 |
| Apps | -0.0004 | 0.0002 | -1.9745 | 0.0483 |
| Top10perc | 0.0326 | 0.0242 | 1.3455 | 0.1785 |
| Outstate | 0.0007 | 0.0001 | 8.7726 | 0.0000 |
| S.F.Ratio | -0.0740 | 0.0424 | -1.7469 | 0.0807 |
| F.Undergrad | -0.0006 | 0.0002 | -4.0343 | 0.0001 |
| Estimate | Std. Error | z value | Pr(>|z|) | |
|---|---|---|---|---|
| (Intercept) | -3.9159 | 0.5572 | -7.028 | 0.0000 |
| Top10perc | 0.0164 | 0.0118 | 1.391 | 0.1641 |
| Accept | -0.0005 | 0.0002 | -2.286 | 0.0223 |
| Enroll | -0.0014 | 0.0006 | -2.213 | 0.0269 |
| Outstate | 0.0008 | 0.0001 | 10.203 | 0.0000 |
| Estimate | Std. Error | z value | Pr(>|z|) | |
|---|---|---|---|---|
| (Intercept) | -2.3163 | 0.9880 | -2.3444 | 0.0191 |
| Top10perc | 0.0229 | 0.0138 | 1.6561 | 0.0977 |
| Accept | 0.0002 | 0.0004 | 0.5731 | 0.5666 |
| Enroll | 0.0012 | 0.0008 | 1.5220 | 0.1280 |
| Outstate | 0.0007 | 0.0001 | 8.7822 | 0.0000 |
| F.Undergrad | -0.0006 | 0.0002 | -4.0344 | 0.0001 |
| Apps | -0.0004 | 0.0002 | -1.9567 | 0.0504 |
| S.F.Ratio | -0.0754 | 0.0423 | -1.7802 | 0.0750 |
We are using the global goodness-of-fit statistics deviation residuals,null deviance, and AIC to asses our models. Using these statistics allows for a measure of the models performance. We see the deviance residual compares the full model to the standard model. Deviance residuals measure how much the probability of our models differ from observed portions of success. We see that bigger values show a worse fit and smaller values mean a better fit. Null Deviance compares the full model to a baseline model. A null deviance residual shows how well a response predicted the model with only the intercept. AIC is used to compare different possible models and determine the best model for the data.
| Deviance.residual | Null.Deviance.Residual | AIC | |
|---|---|---|---|
| full.model | 288.6 | 910.8 | 306.6 |
| reduced.model | 320.9 | 910.8 | 330.9 |
| final.model | 288.8 | 910.8 | 304.8 |
Once completing the goodness of fit statistics between the full and reduced model we see there are differences between some. The full model does better when it comes to deviance as it has a lower deviance residual and a lower AIC value. From the Global goodness of fit statistics we see the lowest AIC value is for the final.model which shows the best model fit when we compare them. The reduced model has the highest deviance value which shows the model is not a good fit. # Final Model
In the exploratory analysis we observed 4 pairs of variables are linearly correlated. After automatics variable selection, Top25perc were dropped from the final model. Enroll, Accept, Apps,F.Undergrad, and Top10perc are still in the model. Although Accept and Top10perc are statistically insignificant, they are still clinically important to the report.
| Estimate | Std. Error | z value | Pr(>|z|) | odds.ratio | |
|---|---|---|---|---|---|
| (Intercept) | -2.3163 | 0.9880 | -2.3444 | 0.0191 | 0.0986 |
| Top10perc | 0.0229 | 0.0138 | 1.6561 | 0.0977 | 1.0232 |
| Accept | 0.0002 | 0.0004 | 0.5731 | 0.5666 | 1.0002 |
| Enroll | 0.0012 | 0.0008 | 1.5220 | 0.1280 | 1.0012 |
| Outstate | 0.0007 | 0.0001 | 8.7822 | 0.0000 | 1.0007 |
| F.Undergrad | -0.0006 | 0.0002 | -4.0344 | 0.0001 | 0.9994 |
| Apps | -0.0004 | 0.0002 | -1.9567 | 0.0504 | 0.9996 |
| S.F.Ratio | -0.0754 | 0.0423 | -1.7802 | 0.0750 | 0.9274 |
The odds ratio represents the odds an outcome will occur given a particular exposure, compared to the odss of the outcome occuring without the exposure.
For example the odds ratio for Top10perc = 1.0232. This shows that for each unit increase in Top10perc the odds of that outcome will increase by 2.3% with the other predictors staying the same.
The case study focused on the association analysis between a set of criteria need to get into a Private colleges. The initial data set has 18 numerical and categorical variables.
After automatic variable selection, we obtain 7 factors, Outstate, Apps, S.F.Ratio,F.Undergrad, Enroll (7 dummy variables), and Top10perc, Accept( not statistically significant but are clinically important).
Since Top10perc, Accept, Enroll,F.Undergrad, and Outstate are considered to be major contributors to the criteria for going to a private College, we must include the 5 factors regardless of their significance.
Gupta, Y. (2019, October 28). US College Data. Kaggle. https://www.kaggle.com/datasets/yashgpt/us-college-data