# Example 2.8, CEO Salary and Firm Sales
# Data set: ceosal1
load("ceosal1.Rdata")
# Recap the estimated model
cat("The example uses the data set of CEO salaries that was used in Example 2.3",
"\nModel to estimate: lsalary = beta0 + beta1 * roe + u",
"\nwhere lsalary is ", paste(desc[desc[,1]=="lsalary",2]),
"\nand lsales is ", paste(desc[desc[,1]=="lsales",2]),
" (sales: ", paste(desc[desc[,1]=="sales",2]), ")",
sep="")
summary(data$lsalary)
summary(data$lsales)
# Estimate and show results
model=lm(lsalary~lsales, data=data)
summary(model)
cat("The estimated regression line is\n",
"lsalaryhat = ", round(model$coefficients[1],digits=3), " + ",
round(model$coefficients[2],digits=3), " * lsales\n",
"n = ", nrow(data), ", R^2 = ", round(summary(model)$r.squared,digits=3), sep="")
# Interpretation
cat("The model is a constant elasticity model. The estimate of the slope coefficient indicates that when sales increase by 1%, salary is predicted to increase by ",
round(model$coefficients[2],digits=3), "%. The coefficient is the estimated elasticity of salary with respect to sales", sep="")