# The file used for data wrangling
collegeDistance <- read.csv("https://vincentarelbundock.github.io/Rdatasets/csv/AER/CollegeDistance.csv", header = TRUE)
# Displaying the summary of the data in the file
print("The summary of the college Distance file is:")
## [1] "The summary of the college Distance file is:"
summary(collegeDistance)
## X gender ethnicity score
## Min. : 1 Length:4739 Length:4739 Min. :28.95
## 1st Qu.: 1186 Class :character Class :character 1st Qu.:43.92
## Median : 2370 Mode :character Mode :character Median :51.19
## Mean : 3955 Mean :50.89
## 3rd Qu.: 3554 3rd Qu.:57.77
## Max. :37810 Max. :72.81
## fcollege mcollege home urban
## Length:4739 Length:4739 Length:4739 Length:4739
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
## unemp wage distance tuition
## Min. : 1.400 Min. : 6.590 Min. : 0.000 Min. :0.2575
## 1st Qu.: 5.900 1st Qu.: 8.850 1st Qu.: 0.400 1st Qu.:0.4850
## Median : 7.100 Median : 9.680 Median : 1.000 Median :0.8245
## Mean : 7.597 Mean : 9.501 Mean : 1.803 Mean :0.8146
## 3rd Qu.: 8.900 3rd Qu.:10.150 3rd Qu.: 2.500 3rd Qu.:1.1270
## Max. :24.900 Max. :12.960 Max. :20.000 Max. :1.4042
## education income region
## Min. :12.00 Length:4739 Length:4739
## 1st Qu.:12.00 Class :character Class :character
## Median :13.00 Mode :character Mode :character
## Mean :13.81
## 3rd Qu.:16.00
## Max. :18.00
# Calculating and displaying the mean of the score field in the file
print("The mean for the score field is:")
## [1] "The mean for the score field is:"
mean(collegeDistance$score)
## [1] 50.88903
# Calculating and displaying the mean of the education field in the file
print("The mean for the education field is:")
## [1] "The mean for the education field is:"
mean(collegeDistance$education)
## [1] 13.80777
# Calculating and displaying the median of the score field in the file
print("The median for the score field is:")
## [1] "The median for the score field is:"
median(collegeDistance$score)
## [1] 51.19
# Calculating and displaying the median of the education field in the file
print("The median for the education field is:")
## [1] "The median for the education field is:"
median(collegeDistance$education)
## [1] 13