This section imports the data on Teacher Ratings from github.
csvurl = "https://raw.githubusercontent.com/Marley-Myrianthopoulos/Grad-School-HW-2/main/TeachingRatings.csv"
teachingratings <- read.csv(url(csvurl))
This section answers #1 from the homework by using the summary function to get an overview of the data set and then determines and displays the mean and median for the ratings of professor beauty and evaluation, rounded to 3 decimal places.
summary(teachingratings)
## X minority age gender
## Min. : 1.0 Length:463 Min. :29.00 Length:463
## 1st Qu.:116.5 Class :character 1st Qu.:42.00 Class :character
## Median :232.0 Mode :character Median :48.00 Mode :character
## Mean :232.0 Mean :48.37
## 3rd Qu.:347.5 3rd Qu.:57.00
## Max. :463.0 Max. :73.00
## credits beauty eval division
## Length:463 Min. :-1.4504940 Min. :2.100 Length:463
## Class :character 1st Qu.:-0.6562689 1st Qu.:3.600 Class :character
## Mode :character Median :-0.0680143 Median :4.000 Mode :character
## Mean : 0.0000001 Mean :3.998
## 3rd Qu.: 0.5456024 3rd Qu.:4.400
## Max. : 1.9700230 Max. :5.000
## native tenure students allstudents
## Length:463 Length:463 Min. : 5.00 Min. : 8.00
## Class :character Class :character 1st Qu.: 15.00 1st Qu.: 19.00
## Mode :character Mode :character Median : 23.00 Median : 29.00
## Mean : 36.62 Mean : 55.18
## 3rd Qu.: 40.00 3rd Qu.: 60.00
## Max. :380.00 Max. :581.00
## prof
## Min. : 1.00
## 1st Qu.:20.00
## Median :44.00
## Mean :45.43
## 3rd Qu.:70.50
## Max. :94.00
beautymean <- round(mean(teachingratings[["beauty"]]), digits = 3)
beautymedian <- round(median(teachingratings[["beauty"]]), digits = 3)
evalmean <- round(mean(teachingratings[["eval"]]), digits = 3)
evalmedian <- round(median(teachingratings[["eval"]]), digits = 3)
print(paste0("The 463 courses measured in this data had professors who were rated on their beauty by a panel of students. These ratings resulted in a mean score of ", beautymean, " and a median score of ", beautymedian, ". The professors' teaching effectiveness was rated by their students, resulting in a mean evaluation score of ", evalmean, " and a median evaluation score of ", evalmedian, "."))
## [1] "The 463 courses measured in this data had professors who were rated on their beauty by a panel of students. These ratings resulted in a mean score of 0 and a median score of -0.068. The professors' teaching effectiveness was rated by their students, resulting in a mean evaluation score of 3.998 and a median evaluation score of 4."
This section answers #2 from the homework by creating a new data frame. The purpose of this frame is to compare the results of tenure track faculty to the whole data set. I’m curious to see how student evaluations of beauty and effectiveness are related just among tenure track faculty.
teachingratings_sub <- subset(teachingratings, tenure == "yes", select = c("age","gender","beauty","eval","prof"))
This section answers #3 from the homework by renaming each column.
colnames(teachingratings_sub) <- c("age_in_years", "gender_identity", "attractiveness", "effectiveness", "prof_id")
This section answers #4 from the homework by using the summary function to get an overview of the new data set of only tenured professors, and then determines and displays the mean and median for the scores of professor beauty (now “attractiveness”) and evaluation (now “effectiveness”), rounded to 3 decimal places. The mean and median for student ratings of professor beauty are slightly lower when the sample is restricted to tenure track professors (from 0 to -0.008 for the mean and and from -0.068 to -0.084 for the median), and the mean student rating of professor effectiveness declined as well (from 3.998 to 3.96) although the median stayed the same (4).
summary(teachingratings_sub)
## age_in_years gender_identity attractiveness effectiveness
## Min. :29.00 Length:361 Min. :-1.450494 Min. :2.10
## 1st Qu.:40.00 Class :character 1st Qu.:-0.656395 1st Qu.:3.60
## Median :47.00 Mode :character Median :-0.083601 Median :4.00
## Mean :47.85 Mean :-0.008013 Mean :3.96
## 3rd Qu.:57.00 3rd Qu.: 0.576681 3rd Qu.:4.40
## Max. :73.00 Max. : 1.775517 Max. :5.00
## prof_id
## Min. : 1.00
## 1st Qu.:24.00
## Median :45.00
## Mean :45.83
## 3rd Qu.:70.00
## Max. :94.00
attractmean <- round(mean(teachingratings_sub[["attractiveness"]]), digits = 3)
attractmedian <- round(median(teachingratings_sub[["attractiveness"]]), digits = 3)
effectmean <- round(mean(teachingratings_sub[["effectiveness"]]), digits = 3)
effectmedian <- round(median(teachingratings_sub[["effectiveness"]]), digits = 3)
print(paste0("When looking only at the tenure track professors in the data set, the ratings for beauty/attractiveness had a mean score of ", attractmean, " and a median score of ", attractmedian, ". For the same subset, the ratings for effectvieness had a mean rating of ", effectmean, " and a median rating of ", effectmedian, "."))
## [1] "When looking only at the tenure track professors in the data set, the ratings for beauty/attractiveness had a mean score of -0.008 and a median score of -0.084. For the same subset, the ratings for effectvieness had a mean rating of 3.96 and a median rating of 4."
This section answers #5 from the homework by replacing the effectiveness ratings with a qualitative descriptor. If the professor’s effectiveness was 3.5 or less, the professor is rated as “developing.” If the rating was greater than 3.5 but less than 4.5, the professor is rated as “effective.” If the rating was 4.5 or higher, the professor is rated as “highly effective.”
teachingratings_sub["effectiveness"][teachingratings_sub["effectiveness"] >= 4.5] <- "highly effective"
teachingratings_sub["effectiveness"][teachingratings_sub["effectiveness"] < 4.5 & teachingratings_sub["effectiveness"] > 3.5] <- "effective"
teachingratings_sub["effectiveness"][teachingratings_sub["effectiveness"] <= 3.5] <- "developing"
teachingratings_sub
## age_in_years gender_identity attractiveness effectiveness prof_id
## 1 36 female 0.2899157 effective 1
## 2 59 male -0.7377322 highly effective 2
## 3 51 male -0.5719836 effective 3
## 4 40 female -0.6779634 effective 4
## 5 31 female 1.5097940 effective 5
## 6 62 male 0.5885687 effective 6
## 7 33 female -0.1260010 effective 7
## 8 51 female -0.2581899 developing 8
## 9 33 female 0.1496926 highly effective 9
## 11 35 male 0.2316134 developing 11
## 13 42 male 0.2168924 effective 13
## 14 49 male -0.2586962 developing 14
## 15 37 female 0.5502878 developing 15
## 16 45 male -0.0620358 highly effective 16
## 19 46 female -0.0680143 effective 19
## 22 29 female -0.8487269 developing 22
## 23 62 male -0.7330914 effective 23
## 24 64 male -0.1111221 effective 24
## 25 34 female 1.7755170 highly effective 25
## 26 58 male -0.3218485 effective 26
## 27 52 male 0.2116939 effective 27
## 28 73 male -0.7176450 developing 28
## 29 70 male -0.7326927 effective 29
## 30 41 female 0.4081676 developing 30
## 32 47 male -0.9239570 highly effective 32
## 33 39 male 0.5766805 effective 33
## 34 47 female -0.0836015 effective 34
## 35 54 male -1.0795580 effective 35
## 36 44 female 1.0409020 effective 36
## 37 47 male -1.0521080 effective 37
## 38 62 male -0.7277681 effective 38
## 39 60 male -0.3953965 highly effective 39
## 40 37 male 0.9333959 developing 40
## 41 42 male -0.2377786 highly effective 41
## 42 35 male 0.2749080 effective 42
## 44 49 male 1.0509500 effective 44
## 45 61 male 0.2418185 highly effective 45
## 46 33 male 1.3493950 highly effective 46
## 47 58 female 0.1115635 developing 47
## 48 56 female -0.2577254 effective 48
## 50 52 male -0.6563948 effective 50
## 51 33 female 0.7244775 effective 51
## 52 57 male 0.6318343 effective 52
## 53 38 female 1.0709440 highly effective 53
## 54 34 female -1.4504940 effective 54
## 55 34 male 1.1558800 developing 55
## 56 32 male -0.3260148 effective 56
## 57 42 female 0.8846435 effective 57
## 58 43 female -0.5583452 effective 58
## 59 35 male -0.3415543 developing 59
## 60 62 female -0.5040575 developing 60
## 61 42 male -0.9005804 effective 61
## 62 39 male 0.6430142 effective 62
## 63 52 female 0.7735240 effective 63
## 64 52 female 1.0639380 developing 64
## 66 64 male -1.0691620 effective 66
## 67 50 male 1.4156950 effective 67
## 68 60 male -1.4229190 developing 68
## 69 51 female 0.3918222 developing 69
## 70 43 male -0.4899626 effective 70
## 72 52 male 0.7566829 developing 72
## 73 51 male 0.8808186 highly effective 73
## 74 38 male -0.5665014 effective 74
## 75 47 female 0.3394037 effective 75
## 76 43 female -0.1513687 effective 76
## 78 43 male -0.0252444 effective 78
## 79 57 male -0.7467875 effective 79
## 80 51 female 0.9889485 effective 80
## 82 57 male -0.7668921 developing 82
## 84 54 female 1.2326020 effective 84
## 86 42 male 1.7731510 highly effective 86
## 87 33 male 0.7245926 effective 87
## 88 62 male -1.1816260 developing 88
## 89 35 female 1.7694520 developing 89
## 90 61 male -0.5872612 effective 90
## 91 52 female -0.0018324 effective 91
## 92 60 female -0.0566766 effective 92
## 93 32 male 1.2313940 effective 93
## 94 42 female 0.4203998 developing 94
## 95 36 female 0.2899157 effective 1
## 96 36 female 0.2899157 effective 1
## 97 36 female 0.2899157 effective 1
## 98 59 male -0.7377322 effective 2
## 99 59 male -0.7377322 developing 2
## 100 51 male -0.5719836 developing 3
## 101 40 female -0.6779634 developing 4
## 102 40 female -0.6779634 effective 4
## 103 40 female -0.6779634 highly effective 4
## 104 40 female -0.6779634 effective 4
## 105 40 female -0.6779634 effective 4
## 106 40 female -0.6779634 effective 4
## 107 40 female -0.6779634 effective 4
## 108 31 female 1.5097940 effective 5
## 109 31 female 1.5097940 highly effective 5
## 110 31 female 1.5097940 highly effective 5
## 111 31 female 1.5097940 effective 5
## 112 31 female 1.5097940 effective 5
## 113 62 male 0.5885687 effective 6
## 114 62 male 0.5885687 highly effective 6
## 115 62 male 0.5885687 effective 6
## 116 62 male 0.5885687 highly effective 6
## 117 62 male 0.5885687 highly effective 6
## 118 62 male 0.5885687 effective 6
## 119 33 female -0.1260010 effective 7
## 120 33 female -0.1260010 effective 7
## 121 33 female -0.1260010 effective 7
## 122 33 female -0.1260010 developing 7
## 123 51 female -0.2581899 highly effective 8
## 124 51 female -0.2581899 highly effective 8
## 125 51 female -0.2581899 highly effective 8
## 126 51 female -0.2581899 developing 8
## 127 51 female -0.2581899 effective 8
## 128 51 female -0.2581899 highly effective 8
## 129 33 female 0.1496926 highly effective 9
## 130 33 female 0.1496926 developing 9
## 131 33 female 0.1496926 highly effective 9
## 132 33 female 0.1496926 effective 9
## 133 33 female 0.1496926 highly effective 9
## 134 33 female 0.1496926 effective 9
## 144 35 male 0.2316134 developing 11
## 145 35 male 0.2316134 effective 11
## 150 42 male 0.2168924 effective 13
## 151 42 male 0.2168924 effective 13
## 152 42 male 0.2168924 effective 13
## 153 42 male 0.2168924 developing 13
## 154 42 male 0.2168924 effective 13
## 155 42 male 0.2168924 effective 13
## 156 49 male -0.2586962 effective 14
## 157 49 male -0.2586962 developing 14
## 158 49 male -0.2586962 effective 14
## 159 37 female 0.5502878 developing 15
## 160 37 female 0.5502878 developing 15
## 161 37 female 0.5502878 developing 15
## 162 45 male -0.0620358 effective 16
## 163 45 male -0.0620358 effective 16
## 164 45 male -0.0620358 effective 16
## 165 45 male -0.0620358 effective 16
## 166 45 male -0.0620358 effective 16
## 178 46 female -0.0680143 highly effective 19
## 179 46 female -0.0680143 effective 19
## 180 46 female -0.0680143 effective 19
## 181 46 female -0.0680143 highly effective 19
## 182 46 female -0.0680143 effective 19
## 183 46 female -0.0680143 highly effective 19
## 184 46 female -0.0680143 effective 19
## 185 46 female -0.0680143 effective 19
## 200 62 male -0.7330914 effective 23
## 201 62 male -0.7330914 highly effective 23
## 202 62 male -0.7330914 effective 23
## 203 62 male -0.7330914 developing 23
## 204 64 male -0.1111221 highly effective 24
## 205 64 male -0.1111221 highly effective 24
## 206 64 male -0.1111221 highly effective 24
## 207 64 male -0.1111221 highly effective 24
## 208 64 male -0.1111221 effective 24
## 209 64 male -0.1111221 effective 24
## 210 34 female 1.7755170 effective 25
## 211 58 male -0.3218485 effective 26
## 212 58 male -0.3218485 developing 26
## 213 58 male -0.3218485 effective 26
## 214 58 male -0.3218485 effective 26
## 215 52 male 0.2116939 highly effective 27
## 216 52 male 0.2116939 highly effective 27
## 217 52 male 0.2116939 effective 27
## 218 52 male 0.2116939 developing 27
## 219 52 male 0.2116939 effective 27
## 220 52 male 0.2116939 effective 27
## 221 73 male -0.7176450 effective 28
## 222 73 male -0.7176450 developing 28
## 223 73 male -0.7176450 highly effective 28
## 224 70 male -0.7326927 effective 29
## 225 70 male -0.7326927 developing 29
## 226 70 male -0.7326927 developing 29
## 233 47 male -0.9239570 effective 32
## 234 47 male -0.9239570 developing 32
## 235 39 male 0.5766805 effective 33
## 236 39 male 0.5766805 highly effective 33
## 237 39 male 0.5766805 effective 33
## 238 39 male 0.5766805 effective 33
## 239 47 female -0.0836015 effective 34
## 240 47 female -0.0836015 effective 34
## 241 47 female -0.0836015 effective 34
## 242 47 female -0.0836015 effective 34
## 243 47 female -0.0836015 developing 34
## 244 47 female -0.0836015 developing 34
## 245 47 female -0.0836015 developing 34
## 246 47 female -0.0836015 highly effective 34
## 247 47 female -0.0836015 effective 34
## 248 47 female -0.0836015 developing 34
## 249 47 female -0.0836015 developing 34
## 250 47 female -0.0836015 effective 34
## 251 54 male -1.0795580 effective 35
## 252 54 male -1.0795580 effective 35
## 253 44 female 1.0409020 developing 36
## 254 44 female 1.0409020 effective 36
## 255 44 female 1.0409020 effective 36
## 256 47 male -1.0521080 developing 37
## 257 47 male -1.0521080 effective 37
## 258 47 male -1.0521080 developing 37
## 259 47 male -1.0521080 effective 37
## 260 47 male -1.0521080 effective 37
## 261 47 male -1.0521080 developing 37
## 262 47 male -1.0521080 developing 37
## 263 62 male -0.7277681 effective 38
## 264 62 male -0.7277681 effective 38
## 265 60 male -0.3953965 highly effective 39
## 266 60 male -0.3953965 highly effective 39
## 267 60 male -0.3953965 highly effective 39
## 268 60 male -0.3953965 effective 39
## 269 60 male -0.3953965 effective 39
## 270 60 male -0.3953965 highly effective 39
## 271 60 male -0.3953965 effective 39
## 272 42 male -0.2377786 effective 41
## 273 42 male -0.2377786 highly effective 41
## 274 42 male -0.2377786 highly effective 41
## 275 42 male -0.2377786 highly effective 41
## 276 35 male 0.2749080 highly effective 42
## 277 35 male 0.2749080 effective 42
## 278 35 male 0.2749080 highly effective 42
## 282 49 male 1.0509500 effective 44
## 283 49 male 1.0509500 effective 44
## 284 61 male 0.2418185 effective 45
## 285 61 male 0.2418185 highly effective 45
## 286 61 male 0.2418185 effective 45
## 287 33 male 1.3493950 developing 46
## 288 33 male 1.3493950 effective 46
## 289 56 female -0.2577254 effective 48
## 290 56 female -0.2577254 developing 48
## 297 52 male -0.6563948 effective 50
## 298 52 male -0.6563948 developing 50
## 299 52 male -0.6563948 developing 50
## 300 52 male -0.6563948 effective 50
## 301 52 male -0.6563948 developing 50
## 302 52 male -0.6563948 effective 50
## 303 52 male -0.6563948 highly effective 50
## 304 52 male -0.6563948 effective 50
## 305 52 male -0.6563948 highly effective 50
## 306 52 male -0.6563948 effective 50
## 307 52 male -0.6563948 highly effective 50
## 308 52 male -0.6563948 effective 50
## 309 33 female 0.7244775 highly effective 51
## 310 33 female 0.7244775 highly effective 51
## 311 33 female 0.7244775 effective 51
## 312 33 female 0.7244775 highly effective 51
## 313 33 female 0.7244775 highly effective 51
## 314 57 male 0.6318343 effective 52
## 315 57 male 0.6318343 effective 52
## 316 57 male 0.6318343 effective 52
## 317 38 female 1.0709440 effective 53
## 318 38 female 1.0709440 highly effective 53
## 319 38 female 1.0709440 effective 53
## 320 38 female 1.0709440 highly effective 53
## 321 38 female 1.0709440 effective 53
## 322 38 female 1.0709440 highly effective 53
## 323 34 female -1.4504940 developing 54
## 324 34 female -1.4504940 effective 54
## 325 34 female -1.4504940 effective 54
## 326 34 female -1.4504940 effective 54
## 327 34 female -1.4504940 effective 54
## 328 34 male 1.1558800 effective 55
## 329 34 male 1.1558800 developing 55
## 330 32 male -0.3260148 effective 56
## 331 32 male -0.3260148 effective 56
## 332 32 male -0.3260148 effective 56
## 333 32 male -0.3260148 highly effective 56
## 334 42 female 0.8846435 effective 57
## 335 43 female -0.5583452 highly effective 58
## 336 43 female -0.5583452 effective 58
## 337 43 female -0.5583452 effective 58
## 338 43 female -0.5583452 effective 58
## 339 43 female -0.5583452 developing 58
## 340 43 female -0.5583452 effective 58
## 341 43 female -0.5583452 effective 58
## 342 43 female -0.5583452 developing 58
## 343 43 female -0.5583452 effective 58
## 344 35 male -0.3415543 developing 59
## 345 62 female -0.5040575 developing 60
## 346 62 female -0.5040575 developing 60
## 347 52 female 0.7735240 effective 63
## 348 52 female 1.0639380 effective 64
## 349 52 female 1.0639380 effective 64
## 356 64 male -1.0691620 effective 66
## 357 64 male -1.0691620 developing 66
## 358 64 male -1.0691620 effective 66
## 359 64 male -1.0691620 effective 66
## 360 64 male -1.0691620 effective 66
## 361 50 male 1.4156950 effective 67
## 362 60 male -1.4229190 developing 68
## 363 60 male -1.4229190 developing 68
## 364 43 male -0.4899626 highly effective 70
## 365 43 male -0.4899626 highly effective 70
## 366 43 male -0.4899626 effective 70
## 367 43 male -0.4899626 effective 70
## 368 43 male -0.4899626 effective 70
## 369 43 male -0.4899626 highly effective 70
## 370 43 male -0.4899626 effective 70
## 371 43 male -0.4899626 highly effective 70
## 381 52 male 0.7566829 effective 72
## 382 52 male 0.7566829 effective 72
## 383 52 male 0.7566829 effective 72
## 384 52 male 0.7566829 effective 72
## 385 52 male 0.7566829 effective 72
## 386 51 male 0.8808186 highly effective 73
## 387 51 male 0.8808186 highly effective 73
## 388 51 male 0.8808186 highly effective 73
## 389 51 male 0.8808186 highly effective 73
## 390 38 male -0.5665014 effective 74
## 391 38 male -0.5665014 effective 74
## 392 38 male -0.5665014 effective 74
## 393 47 female 0.3394037 developing 75
## 394 43 female -0.1513687 developing 76
## 400 43 male -0.0252444 effective 78
## 401 43 male -0.0252444 effective 78
## 402 43 male -0.0252444 developing 78
## 403 57 male -0.7467875 developing 79
## 404 57 male -0.7467875 effective 79
## 405 51 female 0.9889485 effective 80
## 406 51 female 0.9889485 developing 80
## 407 51 female 0.9889485 highly effective 80
## 411 57 male -0.7668921 developing 82
## 412 57 male -0.7668921 effective 82
## 413 57 male -0.7668921 effective 82
## 414 57 male -0.7668921 effective 82
## 415 57 male -0.7668921 effective 82
## 416 57 male -0.7668921 highly effective 82
## 417 57 male -0.7668921 highly effective 82
## 418 57 male -0.7668921 highly effective 82
## 419 57 male -0.7668921 effective 82
## 420 57 male -0.7668921 effective 82
## 425 54 female 1.2326020 highly effective 84
## 426 54 female 1.2326020 effective 84
## 427 54 female 1.2326020 highly effective 84
## 428 54 female 1.2326020 effective 84
## 436 42 male 1.7731510 effective 86
## 437 42 male 1.7731510 effective 86
## 438 33 male 0.7245926 effective 87
## 439 62 male -1.1816260 developing 88
## 440 62 male -1.1816260 developing 88
## 441 62 male -1.1816260 developing 88
## 442 62 male -1.1816260 effective 88
## 443 62 male -1.1816260 developing 88
## 444 62 male -1.1816260 developing 88
## 445 35 female 1.7694520 effective 89
## 446 35 female 1.7694520 effective 89
## 447 61 male -0.5872612 effective 90
## 448 52 female -0.0018324 highly effective 91
## 449 52 female -0.0018324 highly effective 91
## 450 60 female -0.0566766 effective 92
## 451 60 female -0.0566766 effective 92
## 452 60 female -0.0566766 effective 92
## 453 60 female -0.0566766 effective 92
## 454 60 female -0.0566766 developing 92
## 455 60 female -0.0566766 effective 92
## 456 32 male 1.2313940 effective 93
## 457 32 male 1.2313940 effective 93
## 458 32 male 1.2313940 highly effective 93
## 459 32 male 1.2313940 developing 93
## 460 32 male 1.2313940 effective 93
## 461 42 female 0.4203998 developing 94
## 462 42 female 0.4203998 developing 94
## 463 42 female 0.4203998 effective 94