# excel file
data <- read_excel("../00_data/Salaries.xlsx")
data
## # A tibble: 397 × 6
## rank discipline yrs.since.phd yrs.service sex salary
## <chr> <chr> <dbl> <dbl> <chr> <dbl>
## 1 Prof B 19 18 Male 139750
## 2 Prof B 20 16 Male 173200
## 3 AsstProf B 4 3 Male 79750
## 4 Prof B 45 39 Male 115000
## 5 Prof B 40 41 Male 141500
## 6 AssocProf B 6 6 Male 97000
## 7 Prof B 30 23 Male 175000
## 8 Prof B 45 45 Male 147765
## 9 Prof B 21 20 Male 119250
## 10 Prof B 18 18 Female 129000
## # ℹ 387 more rows
What is the correlation between years since phd and years of service?
ggplot(data = data) +
geom_point(mapping = aes(x = yrs.service, y = yrs.since.phd))
It seems to be that there is almost a direct correlation with years of service and years since phd, as the plot has formed a line upwards and to the right with few points straying from the line.