Running ‘Ch-Basics.R’ [4s/15s]
  Comparing ‘Ch-Basics.Rout’ to ‘Ch-Basics.Rout.save’ ...342c342
< [1] 3 2 4 5 1
---
> [1] 5 1 2 3 4
  Running ‘Ch-Intro.R’ [4s/15s]
  Running ‘Ch-LinearRegression.R’ [9s/37s]
  Comparing ‘Ch-LinearRegression.Rout’ to ‘Ch-LinearRegression.Rout.save’ ...806,808c806,808
<              Estimate Std. Error z-value Pr(>|z|)
< (Intercept) -109.9766    61.7014   -1.78    0.075
< value          0.1043     0.0150    6.95  3.6e-12
---
>              Estimate Std. Error t-value Pr(>|t|)
> (Intercept) -109.9766    61.7014   -1.78     0.08
> value          0.1043     0.0150    6.95  3.8e-09
815c815
< Chisq: 383.089 on 2 DF, p-value: <2e-16
---
> F-statistic: 191.545 on 2 and 57 DF, p-value: <2e-16
858,860d857
< Warning messages:
< 1: use of 'dynformula' is deprecated, use a multi-part formula instead 
< 2: use of 'dynformula' is deprecated, use a multi-part formula instead 
  Running ‘Ch-Microeconometrics.R’ [5s/19s]
  Comparing ‘Ch-Microeconometrics.Rout’ to ‘Ch-Microeconometrics.Rout.save’ ...247c247
< southernyes  3.13e+01   1.73e+07    0.00    1.000
---
> southernyes  3.33e+01   1.73e+07    0.00    1.000
602c602
< 2    594  2  4.91      0.086
---
> 2    594  2  1.59       0.45
  Running ‘Ch-Programming.R’ [43s/166s]
  Comparing ‘Ch-Programming.Rout’ to ‘Ch-Programming.Rout.save’ ...200,201c200,201
< t1*   4.7662 -0.001908     0.05588
< t2*  -0.5331 -0.001036     0.03388
---
> t1*   4.7662 -0.0010560     0.05545
> t2*  -0.5331 -0.0001606     0.03304
229c229
< 95%   (-0.5945, -0.4627 )  
---
> 95%   (-0.5952, -0.4665 )  
  Running ‘Ch-TimeSeries.R’ [8s/33s]
  Comparing ‘Ch-TimeSeries.Rout’ to ‘Ch-TimeSeries.Rout.save’ ... OK
  Running ‘Ch-Validation.R’ [37s/145s]
  Comparing ‘Ch-Validation.Rout’ to ‘Ch-Validation.Rout.save’ ...208c208
< RESET = 1.4, df1 = 2, df2 = 176, p-value = 0.2
---
> RESET = 1.4, df1 = 2, df2 = 180, p-value = 0.2
232c232
< HC = 5.1, df = 177, p-value = 9e-07
---
> HC = 5.1, df = 180, p-value = 9e-07
271c271
< X-squared = 176, df = 1, p-value <2e-16
---
> X-squared = 180, df = 1, p-value <2e-16
284c284
< LM test = 193, df = 1, p-value <2e-16
---
> LM test = 190, df = 1, p-value <2e-16
Running the tests in ‘tests/Ch-Intro.R’ failed.
Complete output:
  > ###################################################
  > ### chunk number 1: setup
  > ###################################################
  > options(prompt = "R> ", continue = "+  ", width = 64,
  +   digits = 4, show.signif.stars = FALSE, useFancyQuotes = FALSE)
  R> 
  R> options(SweaveHooks = list(onefig =   function() {par(mfrow = c(1,1))},
  +                             twofig =   function() {par(mfrow = c(1,2))},                           
  +                             threefig = function() {par(mfrow = c(1,3))},
  +                             fourfig =  function() {par(mfrow = c(2,2))},
  +                             sixfig =   function() {par(mfrow = c(3,2))}))
  R> 
  R> library("AER")
  Loading required package: car
  Loading required package: carData
  Loading required package: lmtest
  Loading required package: zoo
  
  Attaching package: 'zoo'
  
  The following objects are masked from 'package:base':
  
      as.Date, as.Date.numeric
  
  Loading required package: sandwich
  Loading required package: survival
  R> 
  R> set.seed(1071)
  R> 
  R> 
  R> ###################################################
  R> ### chunk number 2: journals-data
  R> ###################################################
  R> data("Journals", package = "AER")
  R> 
  R> 
  R> ###################################################
  R> ### chunk number 3: journals-dim
  R> ###################################################
  R> dim(Journals)
  [1] 180  10
  R> names(Journals)
   [1] "title"        "publisher"    "society"      "price"       
   [5] "pages"        "charpp"       "citations"    "foundingyear"
   [9] "subs"         "field"       
  R> 
  R> 
  R> ###################################################
  R> ### chunk number 4: journals-plot eval=FALSE
  R> ###################################################
  R> ## plot(log(subs) ~ log(price/citations), data = Journals)
  R> 
  R> 
  R> ###################################################
  R> ### chunk number 5: journals-lm eval=FALSE
  R> ###################################################
  R> ## j_lm <- lm(log(subs) ~ log(price/citations), data = Journals)
  R> ## abline(j_lm)
  R> 
  R> 
  R> ###################################################
  R> ### chunk number 6: journals-lmplot
  R> ###################################################
  R> plot(log(subs) ~ log(price/citations), data = Journals)
  R> j_lm <- lm(log(subs) ~ log(price/citations), data = Journals)
  R> abline(j_lm)
  R> 
  R> 
  R> ###################################################
  R> ### chunk number 7: journals-lm-summary
  R> ###################################################
  R> summary(j_lm)
  
  Call:
  lm(formula = log(subs) ~ log(price/citations), data = Journals)
  
  Residuals:
      Min      1Q  Median      3Q     Max 
  -2.7248 -0.5361  0.0372  0.4662  1.8481 
  
  Coefficients:
                       Estimate Std. Error t value Pr(>|t|)
  (Intercept)            4.7662     0.0559    85.2   <2e-16
  log(price/citations)  -0.5331     0.0356   -15.0   <2e-16
  
  Residual standard error: 0.75 on 178 degrees of freedom
  Multiple R-squared:  0.557,	Adjusted R-squared:  0.555 
  F-statistic:  224 on 1 and 178 DF,  p-value: <2e-16
  
  R> 
  R> 
  R> ###################################################
  R> ### chunk number 8: cps-data
  R> ###################################################
  R> data("CPS1985", package = "AER")
  R> cps <- CPS1985
  R> 
  R> 
  R> ###################################################
  R> ### chunk number 9: cps-data1 eval=FALSE
  R> ###################################################
  R> ## data("CPS1985", package = "AER")
  R> ## cps <- CPS1985
  R> 
  R> 
  R> ###################################################
  R> ### chunk number 10: cps-reg
  R> ###################################################
  R> library("quantreg")
  Loading required package: SparseM
  
  Attaching package: 'SparseM'
  
  The following object is masked from 'package:base':
  
      backsolve
  
  
  Attaching package: 'quantreg'
  
  The following object is masked from 'package:survival':
  
      untangle.specials
  
  R> cps_lm <- lm(log(wage) ~ experience + I(experience^2) +
  +    education, data = cps)
  R> cps_rq <- rq(log(wage) ~ experience + I(experience^2) +
  +    education, data = cps, tau = seq(0.2, 0.8, by = 0.15))
  R> 
  R> 
  R> ###################################################
  R> ### chunk number 11: cps-predict
  R> ###################################################
  R> cps2 <- data.frame(education = mean(cps$education),
  +    experience = min(cps$experience):max(cps$experience))
  R> cps2 <- cbind(cps2, predict(cps_lm, newdata = cps2,
  +    interval = "prediction"))
  R> cps2 <- cbind(cps2,
  +    predict(cps_rq, newdata = cps2, type = ""))  
  R> 
  R> 
  R> ###################################################
  R> ### chunk number 12: rq-plot eval=FALSE
  R> ###################################################
  R> ## plot(log(wage) ~ experience, data = cps)
  R> ## for(i in 6:10) lines(cps2[,i] ~ experience,
  R> ##   data = cps2, col = "red")
  R> 
  R> 
  R> ###################################################
  R> ### chunk number 13: rq-plot1
  R> ###################################################
  R> plot(log(wage) ~ experience, data = cps)
  R> for(i in 6:10) lines(cps2[,i] ~ experience,
  +    data = cps2, col = "red")
  R> 
  R> 
  R> ###################################################
  R> ### chunk number 14: srq-plot eval=FALSE
  R> ###################################################
  R> ## plot(summary(cps_rq))
  R> 
  R> 
  R> ###################################################
  R> ### chunk number 15: srq-plot1
  R> ###################################################
  R> plot(summary(cps_rq))
  Error in plot.window(...) : infinite axis extents [GEPretty(-inf,inf,5)]
  Calls: plot ... plot.summary.rqs -> plot -> plot.default -> localWindow -> plot.window
  In addition: Warning message:
  In rq.fit.br(x, y, tau = tau, ci = TRUE, ...) : Solution may be nonunique
  Execution halted