Errors in running code in vignettes:
when running code in 'sandwich-OOP.Rnw'

> options(prompt = "R> ", continue = "+   ")

> if (!require("AER")) tobit <- glm
Loading required package: 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

> if (!require("MASS")) glm.nb <- glm
Loading required package: MASS

> if (!require("lmtest")) coeftest <- function(object, 
+     ...) summary(object)$coefficients

> warn <- if (require("AER") & require("MASS") & require("lmtest")) "" else "{\\\\large\\\\bf\\\\color{Red}\n   Not all required packages were availab ..." ... [TRUNCATED] 

> par(mar = rep(0, 4))

> plot(0, 0, xlim = c(0, 85), ylim = c(0, 110), type = "n", 
+     axes = FALSE, xlab = "", ylab = "")

> lgrey <- grey(0.88)

> dgrey <- grey(0.75)

> rect(45, 90, 70, 110, lwd = 2, col = dgrey)

> rect(20, 40, 40, 60, col = lgrey)

> rect(30, 40, 40, 60, col = dgrey)

> rect(20, 40, 40, 60, lwd = 2)

> rect(5, 0, 20, 20, lwd = 2, col = lgrey)

> rect(22.5, 0, 37.5, 20, lwd = 2, col = lgrey)

> rect(40, 0, 55, 20, lwd = 2, col = lgrey)

> rect(40, 0, 55, 20, lwd = 2, col = lgrey)

> rect(60, 0, 80, 20, col = lgrey)

> rect(70, 0, 80, 20, col = dgrey)

> rect(60, 0, 80, 20, lwd = 2)

> text(57.5, 100, "fitted model object\n(class: foo)")

> text(25, 50, "estfun")

> text(35, 50, "foo")

> text(12.5, 10, "meatHC")

> text(30, 10, "meatHAC")

> text(47.5, 10, "meat")

> text(65, 10, "bread")

> text(75, 10, "foo")

> arrows(57.5, 89, 70, 21, lwd = 1.5, length = 0.15, 
+     angle = 20)

> arrows(57.5, 89, 30, 61, lwd = 1.5, length = 0.15, 
+     angle = 20)

> arrows(30, 39, 30, 21, lwd = 1.5, length = 0.15, angle = 20)

> arrows(30, 39, 12.5, 21, lwd = 1.5, length = 0.15, 
+     angle = 20)

> arrows(30, 39, 47.5, 21, lwd = 1.5, length = 0.15, 
+     angle = 20)

> suppressWarnings(RNGversion("3.5.0"))

> set.seed(123)

> x <- rnorm(250)

> y <- rnbinom(250, mu = exp(1 + x), size = 1)

> fm_pois <- glm(y ~ x + I(x^2), family = poisson)

> coeftest(fm_pois)

z test of coefficients:

             Estimate Std. Error z value Pr(>|z|)    
(Intercept)  1.063268   0.041357 25.7094  < 2e-16 ***
x            0.996072   0.053534 18.6062  < 2e-16 ***
I(x^2)      -0.049124   0.023146 -2.1223  0.03381 *  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1


> coeftest(fm_pois, vcov = sandwich)

z test of coefficients:

             Estimate Std. Error z value Pr(>|z|)    
(Intercept)  1.063268   0.083776 12.6918   <2e-16 ***
x            0.996072   0.105217  9.4668   <2e-16 ***
I(x^2)      -0.049124   0.036284 -1.3539   0.1758    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1


> fm_qpois <- glm(y ~ x + I(x^2), family = quasipoisson)

> coeftest(fm_qpois)

z test of coefficients:

             Estimate Std. Error z value Pr(>|z|)    
(Intercept)  1.063268   0.090435 11.7572   <2e-16 ***
x            0.996072   0.117063  8.5088   <2e-16 ***
I(x^2)      -0.049124   0.050613 -0.9706   0.3318    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1


> fm_nbin <- glm.nb(y ~ x + I(x^2))

> coeftest(fm_nbin)

z test of coefficients:

             Estimate Std. Error z value Pr(>|z|)    
(Intercept)  1.066057   0.088574 12.0358   <2e-16 ***
x            0.999616   0.094894 10.5340   <2e-16 ***
I(x^2)      -0.052652   0.064883 -0.8115   0.4171    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1


> if (require("AER")) {
+     library("AER")
+     data("Affairs", package = "AER")
+     fm_tobit <- tobit(affairs ~ age + yearsmarried + religiousne .... [TRUNCATED] 

> coeftest(fm_tobit)

z test of coefficients:

               Estimate Std. Error z value  Pr(>|z|)    
(Intercept)    8.174197   2.741446  2.9817  0.002866 ** 
age           -0.179333   0.079093 -2.2674  0.023368 *  
yearsmarried   0.554142   0.134518  4.1195 3.798e-05 ***
religiousness -1.686220   0.403752 -4.1764 2.962e-05 ***
occupation     0.326053   0.254425  1.2815  0.200007    
rating        -2.284973   0.407828 -5.6028 2.109e-08 ***
Log(scale)     2.109859   0.067098 31.4444 < 2.2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1


> coeftest(fm_tobit, vcov = sandwich)

z test of coefficients:

               Estimate Std. Error z value  Pr(>|z|)    
(Intercept)    8.174197   3.077933  2.6557  0.007913 ** 
age           -0.179333   0.088915 -2.0169  0.043706 *  
yearsmarried   0.554142   0.137162  4.0400 5.344e-05 ***
religiousness -1.686220   0.399854 -4.2171 2.475e-05 ***
occupation     0.326053   0.245978  1.3255  0.184993    
rating        -2.284973   0.393479 -5.8071 6.356e-09 ***
Log(scale)     2.109859   0.054837 38.4754 < 2.2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1


> coeftest(fm_probit)

z test of coefficients:

               Estimate Std. Error z value  Pr(>|z|)    
(Intercept)    0.976668   0.365375  2.6731 0.0075163 ** 
age           -0.022024   0.010319 -2.1343 0.0328214 *  
yearsmarried   0.059901   0.017121  3.4986 0.0004677 ***
religiousness -0.183646   0.051715 -3.5511 0.0003836 ***
occupation     0.037513   0.032845  1.1421 0.2533995    
rating        -0.272983   0.052574 -5.1923 2.077e-07 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1


> coeftest(fm_probit, vcov = sandwich)

z test of coefficients:

               Estimate Std. Error z value  Pr(>|z|)    
(Intercept)    0.976668   0.393033  2.4850 0.0129569 *  
age           -0.022024   0.011274 -1.9534 0.0507678 .  
yearsmarried   0.059901   0.017557  3.4119 0.0006452 ***
religiousness -0.183646   0.053047 -3.4620 0.0005363 ***
occupation     0.037513   0.032922  1.1395 0.2545089    
rating        -0.272983   0.053327 -5.1190 3.071e-07 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1


 *** Run successfully completed ***
> proc.time()
   user  system elapsed 
   1.59    0.29    1.87 

... incomplete output.  Crash?
when running code in 'sandwich.Rnw'

> library("zoo")

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric


> library("sandwich")

> options(prompt = "R> ", continue = "+   ")

> warn <- FALSE

> if (require("strucchange")) {
+     data("RealInt", package = "strucchange")
+     strucchange_version <- gsub("-", "--", packageDescription("strucc ..." ... [TRUNCATED] 
Loading required package: strucchange

> if (!require("lmtest")) {
+     warn <- TRUE
+     coeftest <- function(object, ...) summary(object, ...)$coefficients
+     lmtest_version <- "0.0- ..." ... [TRUNCATED] 
Loading required package: lmtest

> if (!require("scatterplot3d")) {
+     warn <- TRUE
+     scatterplot3d <- function(object, ...) {
+         plot(object, main = "")
+         list( .... [TRUNCATED] 
Loading required package: scatterplot3d

> warn <- if (warn) {
+     "{\\\\large\\\\bf\\\\color{Red}\n   Not all required packages were available when rendering this version of the vignette!\ ..." ... [TRUNCATED] 

> curve(kweights(x, kernel = "Quadratic", normalize = TRUE), 
+     from = 0, to = 3.2, xlab = "x", ylab = "K(x)")

> curve(kweights(x, kernel = "Bartlett", normalize = TRUE), 
+     from = 0, to = 3.2, col = 2, add = TRUE)

> curve(kweights(x, kernel = "Parzen", normalize = TRUE), 
+     from = 0, to = 3.2, col = 3, add = TRUE)

> curve(kweights(x, kernel = "Tukey", normalize = TRUE), 
+     from = 0, to = 3.2, col = 4, add = TRUE)

> lines(c(0, 0.5), c(1, 1), col = 6)

> lines(c(0.5, 0.5), c(1, 0), lty = 3, col = 6)

> lines(c(0.5, 3.2), c(0, 0), col = 6)

> curve(kweights(x, kernel = "Quadratic", normalize = TRUE), 
+     from = 0, to = 3.2, col = 1, add = TRUE)

> text(0.5, 0.98, "Truncated", pos = 4)

> text(0.8, kweights(0.8, "Bartlett", normalize = TRUE), 
+     "Bartlett", pos = 4)

> text(1.35, kweights(1.4, "Quadratic", normalize = TRUE), 
+     "Quadratic Spectral", pos = 2)

> text(1.15, 0.29, "Parzen", pos = 4)

> arrows(1.17, 0.29, 1, kweights(1, "Parzen", normalize = TRUE), 
+     length = 0.1)

> text(1.3, 0.2, "Tukey-Hanning", pos = 4)

> arrows(1.32, 0.2, 1.1, kweights(1.1, "Tukey", normalize = TRUE), 
+     length = 0.1)

> data("PublicSchools")

> ps <- na.omit(PublicSchools)

> ps$Income <- ps$Income * 1e-04

> fm.ps <- lm(Expenditure ~ Income + I(Income^2), data = ps)

> coeftest(fm.ps, df = Inf, vcov = vcovHC(fm.ps, type = "HC0"))

z test of coefficients:

            Estimate Std. Error z value Pr(>|z|)  
(Intercept)   832.91     460.89  1.8072  0.07073 .
Income      -1834.20    1243.04 -1.4756  0.14006  
I(Income^2)  1587.04     829.99  1.9121  0.05586 .
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1


> coeftest(fm.ps, df = Inf, vcov = vcovHC(fm.ps, type = "HC4"))

z test of coefficients:

            Estimate Std. Error z value Pr(>|z|)
(Intercept)   832.91    3008.01  0.2769   0.7819
Income      -1834.20    8183.19 -0.2241   0.8226
I(Income^2)  1587.04    5488.93  0.2891   0.7725


> plot(Expenditure ~ Income, data = ps, xlab = "per capita income", 
+     ylab = "per capita spending on public schools")

> inc <- seq(0.5, 1.2, by = 0.001)

> lines(inc, predict(fm.ps, data.frame(Income = inc)), 
+     col = 4, lty = 2)

> fm.ps2 <- lm(Expenditure ~ Income, data = ps)

> abline(fm.ps2, col = 4)

> text(ps[2, 2], ps[2, 1], rownames(ps)[2], pos = 2)

> data("Investment")

> fm.inv <- lm(RealInv ~ RealGNP + RealInt, data = Investment)

> coeftest(fm.inv, df = Inf, vcov = NeweyWest(fm.inv, 
+     lag = 4, prewhite = FALSE))

z test of coefficients:

              Estimate Std. Error z value Pr(>|z|)    
(Intercept) -12.533601  18.958298 -0.6611   0.5085    
RealGNP       0.169136   0.016751 10.0972   <2e-16 ***
RealInt      -1.001438   3.342375 -0.2996   0.7645    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1


> coeftest(fm.inv, df = Inf, vcov = NeweyWest)

z test of coefficients:

              Estimate Std. Error z value  Pr(>|z|)    
(Intercept) -12.533601  24.374177 -0.5142    0.6071    
RealGNP       0.169136   0.023586  7.1709 7.449e-13 ***
RealInt      -1.001438   3.639935 -0.2751    0.7832    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1


> parzenHAC <- function(x, ...) kernHAC(x, kernel = "Parzen", 
+     prewhite = 2, adjust = FALSE, bw = bwNeweyWest, ...)

> coeftest(fm.inv, df = Inf, vcov = parzenHAC)

z test of coefficients:

              Estimate Std. Error z value  Pr(>|z|)    
(Intercept) -12.533601  24.663944 -0.5082    0.6113    
RealGNP       0.169136   0.020835  8.1181 4.737e-16 ***
RealInt      -1.001438   3.947469 -0.2537    0.7997    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1


> s3d <- scatterplot3d(Investment[, c(5, 7, 6)], type = "b", 
+     angle = 65, scale.y = 1, pch = 16)

> s3d$plane3d(fm.inv, lty.box = "solid", col = 4)

> ocus <- gefp(RealInt ~ 1, fit = lm, vcov = kernHAC)

> bp <- breakpoints(RealInt ~ 1)

> confint(bp, vcov = kernHAC)

	 Confidence intervals for breakpoints
	 of optimal 3-segment partition: 

Call:
confint.breakpointsfull(object = bp, vcov. = kernHAC)

Breakpoints at observation number:
  2.5 % breakpoints 97.5 %
1    37          47     48
2    77          79     81

Corresponding to breakdates:
  2.5 %   breakpoints 97.5 % 
1 1970(1) 1972(3)     1972(4)
2 1980(1) 1980(3)     1981(1)

> par(mfrow = c(1, 2))

> plot(ocus, aggregate = FALSE, main = "")

> plot(RealInt, ylab = "Real interest rate")

> lines(ts(fitted(bp), start = start(RealInt), frequency = 4), 
+     col = 4)

> lines(confint(bp, vcov = kernHAC))

> options(prompt = "  ")

 *** Run successfully completed ***
> proc.time()
   user  system elapsed 
   0.87    0.29    1.11 

... incomplete output.  Crash?

  'sandwich-CL.Rnw'... [11s] NOTE
differences from 'sandwich-CL.Rout.save'
82c82
< Classes and Methods for R originally developed in the
---
> Classes and Methods for R developed in the
85,87c85,87
< Stanford University (2002-2015),
< by and under the direction of Simon Jackman.
< hurdle and zeroinfl functions by Achim Zeileis.
---
> Stanford University
> Simon Jackman
> hurdle and zeroinfl functions by Achim Zeileis
  'sandwich-OOP.Rnw'... failed to complete the test
  'sandwich.Rnw'... failed to complete the test