2 December 2016

App purpose and data used

  1. The app outputs projected salary based on two different models.
  2. Follwing data were used to build salary models:
    • For my app I used the follwoing data
    • Available in R package car.
    • Ranks: assistant professor, associate professor, professor.
    • Discipline: theoretical” departments or “applied” departments.
    • Sex: male or female.
    • Years since PhD varies between 1 and 56.
    • Salary: 2008-09 nine-month academic salary in a college in the U.S.

Models

Two linear regression models are created to model professor salary based on the rank, discipline, sex and years since the completion PhD.

  • Model 1 is created based only on two factors: rank and discipline.
 model1 <- lm(salary ~ rank + discipline, data = Salaries)
  • Model 2 is based on four factors: rank, discipline, sex and years since PhD.
 model2 <- lm(salary ~ rank + discipline + sex + yrs.since.phd, 
              data = Salaries)

Example

Let's consider the following example:

  newdata <- data.frame(rank = "Prof", discipline = "A",sex = "Female", 
                        yrs.since.phd = 20)
  predict(model1,newdata)
##        1 
## 119788.2
  predict(model2,newdata)
##        1 
## 115137.1

Models produced different salary as they were build using different factors.

App Screenshot