# Example 10.5, Antidumping Filings and Chemical Imports
# Data set: barium
# Function for result reporting
source("_report.R")
# Load the data and estimate the model in the background
load("barium.Rdata")
data=ts(data,start=c(1978,2),frequency=12)
model=lm(lchnimp~lchempi+lgas+lrtwex+befile6+affile6+afdec6,data=data)
dig=c(2,2,3,3,3,3,3,3)
# Describe the model
cat("The data set contains data about an industrial chemical, barium chloride, pariticularly about the antidumping filings over its imports from China (against their unfairly low prices)",
"\nModel to estimate: lchnimp = beta0 + beta1 * lchempi + beta2 * lgas + beta3 * lrtwex + beta4 * befile6 + beta5 * affile6 + beta6 * afdec6 + u",
"\nwhere lchnimp is ", paste(desc[desc[,1]=="lchnimp",2]), " (chnimp: ", paste(desc[desc[,1]=="chnimp",2]), ")",
"\nlchempi is ", paste(desc[desc[,1]=="lchempi",2]), " (chempi: ", paste(desc[desc[,1]=="chempi",2]), ")",
"\nlgas is ", paste(desc[desc[,1]=="lgas",2]), " (gas: ", paste(desc[desc[,1]=="gas",2]), ")",
"\nlrtwex is ", paste(desc[desc[,1]=="lrtwex",2]), " (rtwex: ", paste(desc[desc[,1]=="rtwex",2]), ")",
"\nbefile6 is ", paste(desc[desc[,1]=="befile6",2]),
"\naffile6 is ", paste(desc[desc[,1]=="affile6",2]),
"\nand afdec6 is ", paste(desc[desc[,1]=="afdec6",2]),
sep="")
# Report results
{
cat("The estimated regression line is")
reportreg(model,dig,adj=T)
}
# Interpretation
cat("Both befile6 and affile6 are statistically insignificant. Therefore, there is no evidence showing that chnimp changed noticeably due to the filing itself. The coefficient on afdec6 is significant at the 5% level against a two-sided alternative, showing a substantial fall in chnimp after an decision in favor of the U.S., and the exact percentage change is ",
100*round(exp(as.numeric(printcoef(model,7,dig[7])))-1,3), " (= 100 * [exp(", printcoef(model,7,dig[7]), ") - 1]) percent",
sep="")