Running examples in ‘pder-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: HousePricesUS
> ### Title: House Prices Data
> ### Aliases: HousePricesUS
> ### Keywords: datasets
> 
> ### ** Examples
> 
> #### Example 4-11
> 
> ## ------------------------------------------------------------------------
> data("HousePricesUS", package = "pder")
> library("plm")
> php <- pdata.frame(HousePricesUS)
> 
> ## ------------------------------------------------------------------------
> cbind("rho"   = pcdtest(diff(log(php$price)), test = "rho")$statistic,
+       "|rho|" = pcdtest(diff(log(php$price)), test = "absrho")$statistic)
Warning in pcdtest.pseries(diff(log(php$price)), test = "rho") :
  NA values encountered in input and removed
Warning in pcdtest.pseries(diff(log(php$price)), test = "absrho") :
  NA values encountered in input and removed
          rho     |rho|
rho 0.3942212 0.4246933
> 
> ## ------------------------------------------------------------------------
> regions.names <- c("New Engl", "Mideast", "Southeast", "Great Lks",
+                    "Plains", "Southwest", "Rocky Mnt", "Far West")
> corr.table.hp <- cortab(diff(log(php$price)), grouping = php$region,
+                         groupnames = regions.names)
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
Warning in pcdtest.pseries(x, test = "rho", w = myw) :
  NA values encountered in input and removed
> colnames(corr.table.hp) <- substr(rownames(corr.table.hp), 1, 5)
> round(corr.table.hp, 2)
          New E Midea South Great Plain South Rocky Far W
New Engl   0.80    NA    NA    NA    NA    NA    NA    NA
Mideast    0.68  0.66    NA    NA    NA    NA    NA    NA
Southeast  0.40  0.35  0.81    NA    NA    NA    NA    NA
Great Lks  0.27  0.20  0.62  0.61    NA    NA    NA    NA
Plains     0.40  0.32  0.57  0.53  0.52    NA    NA    NA
Southwest  0.07 -0.05  0.28  0.39  0.35  0.52    NA    NA
Rocky Mnt -0.03 -0.11  0.52  0.53  0.40  0.57  0.70    NA
Far West   0.13  0.17  0.52  0.42  0.29  0.31  0.46  0.57
> 
> ## ------------------------------------------------------------------------
> pcdtest(diff(log(price)) ~ diff(lag(log(price))) + diff(lag(log(price), 2)),
+         data = php)

	Pesaran CD test for cross-sectional dependence in panels

data:  diff(log(price)) ~ diff(lag(log(price))) + diff(lag(log(price),     2))
z = 59.009, p-value < 2.2e-16
alternative hypothesis: cross-sectional dependence

> 
> #### Example 9-2
> 
> ## ------------------------------------------------------------------------
> data("HousePricesUS", package = "pder")
> swmod <- pvcm(log(price) ~ log(income), data = HousePricesUS, model= "random")
> mgmod <- pmg(log(price) ~ log(income), data = HousePricesUS, model = "mg")
> coefs <- cbind(coef(swmod), coef(mgmod))
> dimnames(coefs)[[2]] <- c("Swamy", "MG")
> coefs
                Swamy        MG
(Intercept) 3.8914242 3.8498054
log(income) 0.2867014 0.3018117
> 
> #### Example 9-3
> 
> ## ------------------------------------------------------------------------
> library("texreg")
Version:  1.37.5
Date:     2020-06-17
Author:   Philip Leifeld (University of Essex)

Consider submitting praise using the praise or praise_interactive functions.
Please cite the JSS article in your publications -- see citation("texreg").
> data("RDSpillovers", package = "pder")
> fm.rds <- lny ~ lnl + lnk + lnrd
> mg.rds <- pmg(fm.rds, RDSpillovers, trend = TRUE)
> dmg.rds <- update(mg.rds, . ~ lag(lny) + .)
> screenreg(list('Static MG' = mg.rds, 'Dynamic MG'= dmg.rds), digits = 3)

=======================================
             Static MG     Dynamic MG  
---------------------------------------
(Intercept)     4.550 ***     4.038 ***
               (0.841)       (0.778)   
lnl             0.568 ***     0.507 ***
               (0.086)       (0.059)   
lnk             0.117         0.020    
               (0.122)       (0.085)   
lnrd           -0.058        -0.092    
               (0.079)       (0.071)   
trend           0.022 **      0.023 ***
               (0.008)       (0.004)   
lag(lny)                      0.223 ***
                             (0.034)   
---------------------------------------
Num. obs.    2637          2518        
=======================================
*** p < 0.001; ** p < 0.01; * p < 0.05
> 
> ## ------------------------------------------------------------------------
> library("msm")
> b.lr <- coef(dmg.rds)["lnrd"]/(1 - coef(dmg.rds)["lag(lny)"])
> SEb.lr <- deltamethod(~ x5 / (1 - x2),
+                       mean = coef(dmg.rds), cov = vcov(dmg.rds))
> z.lr <- b.lr / SEb.lr
> pval.lr <- 2 * pnorm(abs(z.lr), lower.tail = FALSE)
> lr.lnrd <- matrix(c(b.lr, SEb.lr, z.lr, pval.lr), nrow=1)
> dimnames(lr.lnrd) <- list("lnrd (long run)", c("Est.", "SE", "z", "p.val"))
> round(lr.lnrd, 3)
                  Est.    SE      z p.val
lnrd (long run) -0.118 0.091 -1.301 0.193
> 
> 
> #### Example 9-4
> 
> ## ------------------------------------------------------------------------
> housep.np <- pvcm(log(price) ~ log(income), data = HousePricesUS, model = "within")
> housep.pool <- plm(log(price) ~ log(income), data = HousePricesUS, model = "pooling")
> housep.within <- plm(log(price) ~ log(income), data = HousePricesUS, model = "within")
> 
> d <- data.frame(x = c(coef(housep.np)[[1]], coef(housep.np)[[2]]), 
+                 coef = rep(c("intercept", "log(income)"), 
+                            each = nrow(coef(housep.np))))
> library("ggplot2")
> ggplot(d, aes(x)) + geom_histogram(col = "black", fill = "white", bins = 8) +
+     facet_wrap(~ coef, scales = "free") + xlab("") + ylab("")
> 
> 
> ## ------------------------------------------------------------------------
> summary(housep.np)
Oneway (individual) effect No-pooling model

Call:
pvcm(formula = log(price) ~ log(income), data = HousePricesUS, 
    model = "within")

Balanced Panel: n = 49, T = 29, N = 1421

Residuals:
        Min.      1st Qu.       Median      3rd Qu.         Max. 
-0.279006789 -0.069921886 -0.005819077  0.064749895  0.352409710 

Coefficients:
  (Intercept)       log(income)     
 Min.   :-0.2951   Min.   :-1.1409  
 1st Qu.: 3.1519   1st Qu.:-0.1378  
 Median : 4.1457   Median : 0.2283  
 Mean   : 3.8498   Mean   : 0.3018  
 3rd Qu.: 4.7773   3rd Qu.: 0.6614  
 Max.   : 6.9108   Max.   : 2.0369  

Total Sum of Squares: 3870.1
Residual Sum of Squares: 13.739
Multiple R-Squared: 0.99645
> 
> ## ------------------------------------------------------------------------
> pooltest(housep.pool, housep.np)

	F statistic

data:  log(price) ~ log(income)
F = 25.778, df1 = 96, df2 = 1323, p-value < 2.2e-16
alternative hypothesis: unstability

> pooltest(housep.within, housep.np)

	F statistic

data:  log(price) ~ log(income)
F = 16.074, df1 = 48, df2 = 1323, p-value < 2.2e-16
alternative hypothesis: unstability

> 
> 
> #### Example 9-5
> 
> ## ------------------------------------------------------------------------
> library("texreg")
> cmgmod <- pmg(log(price) ~ log(income), data = HousePricesUS, model = "cmg")
> screenreg(list(mg = mgmod, ccemg = cmgmod), digits = 3)

===========================================
                 mg            ccemg       
-------------------------------------------
(Intercept)         3.850 ***    -0.115    
                   (0.204)       (0.256)   
log(income)         0.302 **      1.135 ***
                   (0.093)       (0.195)   
y.bar                             1.047 ***
                                 (0.058)   
log(income).bar                  -1.195 ***
                                 (0.199)   
-------------------------------------------
Num. obs.        1421          1421        
===========================================
*** p < 0.001; ** p < 0.01; * p < 0.05
> 
> #### Example 9-6
> 
> ## ------------------------------------------------------------------------
> ccemgmod <- pcce(log(price) ~ log(income), data=HousePricesUS, model="mg")
> summary(ccemgmod)
Common Correlated Effects Mean Groups model

Call:
pcce(formula = log(price) ~ log(income), data = HousePricesUS, 
    model = "mg")

Balanced Panel: n = 49, T = 29, N = 1421

Residuals:
         Min.       1st Qu.        Median       3rd Qu.          Max. 
-0.2374375681 -0.0354899189  0.0002718432  0.0363911744  0.2242332666 

Coefficients:
            Estimate Std. Error z-value  Pr(>|z|)    
log(income)  1.13540    0.19546   5.809 6.285e-09 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Total Sum of Squares: 47.234
Residual Sum of Squares: 5.6567
HPY R-squared: 0.74027
> 
> ## ------------------------------------------------------------------------
> ccepmod <- pcce(log(price) ~ log(income), data=HousePricesUS, model="p")
> summary(ccepmod)
Common Correlated Effects Pooled model

Call:
pcce(formula = log(price) ~ log(income), data = HousePricesUS, 
    model = "p")

Balanced Panel: n = 49, T = 29, N = 1421

Residuals:
        Min.      1st Qu.       Median      3rd Qu.         Max. 
-0.278832515 -0.039280795 -0.002088593  0.039268254  0.299929865 

Coefficients:
            Estimate Std. Error z-value  Pr(>|z|)    
log(income)  1.19941    0.20728  5.7864 7.193e-09 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Total Sum of Squares: 47.234
Residual Sum of Squares: 6.8851
HPY R-squared: 0.69579
> 
> 
> 
> #### Example 9-8
> 
> ## ------------------------------------------------------------------------
> data("HousePricesUS", package = "pder")
> price <- pdata.frame(HousePricesUS)$price
> purtest(log(price), test = "levinlin", lags = 2, exo = "trend")

	Levin-Lin-Chu Unit-Root Test (ex. var.: Individual Intercepts and
	Trend)

data:  log(price)
z = -1.2573, p-value = 0.1043
alternative hypothesis: stationarity

> purtest(log(price), test = "madwu", lags = 2, exo = "trend")

	Maddala-Wu Unit-Root Test (ex. var.: Individual Intercepts and Trend)

data:  log(price)
chisq = 99.843, df = 98, p-value = 0.4292
alternative hypothesis: stationarity

> purtest(log(price), test = "ips", lags = 2, exo = "trend")

	Im-Pesaran-Shin Unit-Root Test (ex. var.: Individual Intercepts and
	Trend)

data:  log(price)
Wtbar = 0.76622, p-value = 0.7782
alternative hypothesis: stationarity

> 
> 
> #### Example 9-9
> 
> ## ------------------------------------------------------------------------
> tab5a <- matrix(NA, ncol = 4, nrow = 2)
> tab5b <- matrix(NA, ncol = 4, nrow = 2)
> 
> for(i in 1:4) {
+     mymod <- pmg(diff(log(income)) ~ lag(log(income)) + 
+                  lag(diff(log(income)), 1:i),
+                  data = HousePricesUS,
+                  model = "mg", trend = TRUE)
+     tab5a[1, i] <- pcdtest(mymod, test = "rho")$statistic
+     tab5b[1, i] <- pcdtest(mymod, test =  "cd")$statistic
+ }
> 
> for(i in 1:4) {
+     mymod <- pmg(diff(log(price)) ~ lag(log(price)) +
+                  lag(diff(log(price)), 1:i),
+                  data=HousePricesUS,
+                  model="mg", trend = TRUE)
+     tab5a[2, i] <- pcdtest(mymod, test = "rho")$statistic
+     tab5b[2, i] <- pcdtest(mymod, test =  "cd")$statistic
+ }
> 
> tab5a <- round(tab5a, 3)
> tab5b <- round(tab5b, 2)
> dimnames(tab5a) <- list(c("income", "price"),
+                         paste("ADF(", 1:4, ")", sep=""))
> dimnames(tab5b) <- dimnames(tab5a)
> 
> tab5a
       ADF(1) ADF(2) ADF(3) ADF(4)
income  0.465  0.443  0.338  0.317
price   0.346  0.326  0.252  0.194
> tab5b
       ADF(1) ADF(2) ADF(3) ADF(4)
income  82.84  77.40  57.96  53.21
price   61.73  57.02  43.21  32.52
> 
> ## ------------------------------------------------------------------------
> php <- pdata.frame(HousePricesUS)
> cipstest(log(php$price), type = "drift")
Warning in cipstest(log(php$price), type = "drift") :
  p-value greater than printed p-value

	Pesaran's CIPS test for unit roots

data:  log(php$price)
CIPS test = -2.0342, lag order = 2, p-value = 0.1
alternative hypothesis: Stationarity

> cipstest(diff(log(php$price)), type = "none")
Warning in cipstest(diff(log(php$price)), type = "none") :
  p-value smaller than printed p-value

	Pesaran's CIPS test for unit roots

data:  diff(log(php$price))
CIPS test = -1.8199, lag order = 2, p-value = 0.01
alternative hypothesis: Stationarity

> 
> ## ------------------------------------------------------------------------
> cipstest(resid(ccemgmod), type="none")
Warning in cipstest(resid(ccemgmod), type = "none") :
  p-value smaller than printed p-value

	Pesaran's CIPS test for unit roots

data:  resid(ccemgmod)
CIPS test = -2.6588, lag order = 2, p-value = 0.01
alternative hypothesis: Stationarity

> cipstest(resid(ccepmod), type="none")
Warning in cipstest(resid(ccepmod), type = "none") :
  p-value smaller than printed p-value

	Pesaran's CIPS test for unit roots

data:  resid(ccepmod)
CIPS test = -2.2397, lag order = 2, p-value = 0.01
alternative hypothesis: Stationarity

> 
> 
> #### Example 10-2
> 
> ## ------------------------------------------------------------------------
> data("usaw49", package="pder")
> library("plm")
> php <- pdata.frame(HousePricesUS)
> pcdtest(php$price, w = usaw49)

	Pesaran CD test for local cross-sectional dependence in panels

data:  php$price
z = 37.288, p-value < 2.2e-16
alternative hypothesis: cross-sectional dependence

> 
> ## ------------------------------------------------------------------------
> library("splm")
Error in library("splm") : there is no package called ‘splm’
Execution halted