# Example 4.8, Model of R&D Expenditures
# Data set: rdchem
# Function for result reporting
source("_report.R")
# Load the data and estimate the model in the background
load("rdchem.Rdata")
model=lm(lrd~lsales+profmarg, data=data)
dig=c(2,3,4,3)
# Describe the model
cat("The data set contains data on 32 U.S. firms in the chemical industry",
"\nModel to estimate: lrd = beta0 + beta1 * lsales + beta2 * profmarg + u",
"\nwhere lrd is ", paste(desc[desc[,1]=="lrd",2]), " (rd: ", paste(desc[desc[,1]=="rd",2]), "), a proxy of firm size",
"\nlsales is ", paste(desc[desc[,1]=="lsales",2]), " (sales: ", paste(desc[desc[,1]=="sales",2]), ")",
"\nand profmarg is ", paste(desc[desc[,1]=="profmarg",2]),
sep="")
# Report results
{
cat("The estimated regression line is")
reportreg(model,dig)
}
# Interpretation
cat("Beta1 is the elastisity of rd with respect to sales. When sales increases by 1%, rd is predicted to increase by ",
printcoef(model,2,dig[2]), "%. With df = ", nrow(model$model)-nrow(summary(model)$coef),
", the two-sided 5% critical value of the t distribution is 2.045. Thus, the 95% confidence interval for beta1 is ",
printcoef(model,2,dig[2]), " ± 2.045 * ", printse(model,2,dig[2]), ", or (",
round(as.numeric(printcoef(model,2,dig[2]))-2.045*as.numeric(printse(model,2,dig[2])),3), ",",
round(as.numeric(printcoef(model,2,dig[2]))+2.045*as.numeric(printse(model,2,dig[2])),2),
"). Zero is outside the interval, indicating that beta1 is statistically significant at the 5% significance level. However, unity is within the interval, hence we cannot reject H0: beta1 = 1 against H1: beta1 ≠ 1 at the 5% level, i.e. the elasticity is not significantly different from unity at the 5% level",
"\nThe 95% confidence interval for beta2 is ",
printcoef(model,3,dig[3]), " ± 2.045 * ", printse(model,3,dig[3]), ", or (",
round(as.numeric(printcoef(model,3,dig[3]))-2.045*as.numeric(printse(model,3,dig[3])),4), ",",
round(as.numeric(printcoef(model,3,dig[3]))+2.045*as.numeric(printse(model,3,dig[3])),4),
"). Zero is within the interval, hence we cannot reject H0: beta2 = 0 against H2: beta0 ≠ 0 at the 5% significance level. In fact, profmarg is statistically significant at the 10% level against the two-sided alternative, or at the 5% level against the one-sided alternative H1: beta2 > 0. Also, the economic size of the coefficient on profmarg is relatively large: when it increases by 1 percentage point, rd is predicted to increase by ",
100*as.numeric(printcoef(model,3,dig[3])), "%",
sep="")