salary

references:
- Wooldridge 5e, example 2.3, p.29
- stan
- plots for MCMC draws, bayesplot
- posterior predictive checks, bayesplot

library(tidyverse)
library(knitr)
library(rstan)
rstan_options(auto_write = TRUE)
options(mc.cores = parallel::detectCores())
library(bayesplot)
library(hexbin)
library(shinystan)

data

load("ceosal1.RData")   # loads data and desc
str(desc)
## 'data.frame':    12 obs. of  2 variables:
##  $ variable: Factor w/ 12 levels "consprod","finance",..: 10 7 11 8 6 9 3 2 1 12 ...
##  $ label   : Factor w/ 12 levels "% change roe, 88-90",..: 8 2 7 11 1 12 5 4 3 6 ...
kable(desc)
variable label
salary 1990 salary, thousands $
pcsalary % change salary, 89-90
sales 1990 firm sales, millions $
roe return on equity, 88-90 avg
pcroe % change roe, 88-90
ros return on firm’s stock, 88-90
indus =1 if industrial firm
finance =1 if financial firm
consprod =1 if consumer product firm
utility =1 if transport. or utilties
lsalary natural log of salary
lsales natural log of sales
(n <- nrow(data))     # sample size
## [1] 209
summary(data$salary)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     223     736    1039    1281    1407   14822
summary(data$roe)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.50   12.40   15.50   17.18   20.00   56.30

salary

ggplot(data, aes(roe, salary)) +
  geom_point(shape = 20, color = "darkred") +
  geom_smooth(method = "lm") +
  labs(title = "CEO Salary")