dta <- read.csv("ncku_prof_V6.csv", h=T, stringsAsFactors = TRUE)

Assessment 1

a1dta <- dta %>%
  filter(H.id > 12) %>%
  select(H.id, Gender, College, Rank, Degree, Grads)
tail(a1dta)
##     H.id Gender College Rank Degree Grads
## 187   14      F     MNG    2      D    17
## 188   13      M     MNG    1      O    89
## 189   15      M     MNG    2      D    27
## 190   17      M     MNG    1      D    26
## 191   27      M     MNG    1      D    23
## 192   14      M     MNG    2      D     9
newdta <- dta %>%
  mutate(academicy = 2022 - FPY,
         Grads_m = Grads / academicy) %>%
  select(H.id, Gender, Degree, Rank, Grads, academicy, Grads_m)
head(newdta)
##   H.id Gender Degree Rank Grads academicy   Grads_m
## 1    9      M      D    3     3         9 0.3333333
## 2   11      M      D    2    10        14 0.7142857
## 3   10      M      D    1     0        11 0.0000000
## 4   65      M      O    1    92        25 3.6800000
## 5   10      F      O    2    25        11 2.2727273
## 6   22      M      D    2    41        20 2.0500000
a3dta <- dta %>%
  group_by(College, Gender, Rank, Degree) %>%
  summarize(m_H.id = mean(H.id, na.rm = TRUE),
            sd_H.id = sd(H.id),
            var_H.id = var(H.id),
            min_H.id = min(H.id),
            max_H.id = max(H.id),
            count = n()) %>%
  arrange(desc(m_H.id))
## `summarise()` has grouped output by 'College', 'Gender', 'Rank'. You can
## override using the `.groups` argument.

2.1 Max: ENG F 1 D, Min: LIB M 3 D

2.2 Not appropriate, there are more paper from male professor than female professor in Engineer

2.3 Most paper from Liberal are trash, the H.id are low.

dta %>%
  select(College, Gender, Rank, Degree) %>%
  tbl_summary(by = College)
## Warning: The `fmt_missing()` function is deprecated and will soon be removed
## * Use the `sub_missing()` function instead
## Warning in normalizePath(path.expand(path), winslash, mustWork): path[1]="C:/
## Users/???/Documents": 檔案名稱、目錄名稱或磁碟區標籤語法錯誤。
Characteristic ENG, N = 1841 LIB, N = 631 MNG, N = 841 SCI, N = 721 SSC, N = 571
Gender
F 17 (9.2%) 34 (54%) 24 (29%) 14 (19%) 22 (39%)
M 167 (91%) 29 (46%) 60 (71%) 58 (81%) 35 (61%)
Rank
1 111 (60%) 29 (46%) 36 (43%) 36 (50%) 28 (49%)
2 44 (24%) 29 (46%) 27 (32%) 27 (38%) 22 (39%)
3 29 (16%) 5 (7.9%) 21 (25%) 9 (12%) 7 (12%)
Degree
D 63 (34%) 21 (33%) 25 (30%) 16 (22%) 13 (23%)
O 121 (66%) 42 (67%) 59 (70%) 56 (78%) 44 (77%)
1 n (%)
  1. All Colleges has more oversea degree professor than domestic degree professor

  2. Liberal school is the only college that has more female professor than male professor

  3. Engineer school has the most professors out of all colleges