1
2R version 4.1.1 (2021-08-10) -- "Kick Things"
3Copyright (C) 2021 The R Foundation for Statistical Computing
4Platform: x86_64-w64-mingw32/x64 (64-bit)
5
6R is free software and comes with ABSOLUTELY NO WARRANTY.
7You are welcome to redistribute it under certain conditions.
8Type 'license()' or 'licence()' for distribution details.
9
10R is a collaborative project with many contributors.
11Type 'contributors()' for more information and
12'citation()' on how to cite R or R packages in publications.
13
14Type 'demo()' for some demos, 'help()' for on-line help, or
15'help.start()' for an HTML browser interface to help.
16Type 'q()' to quit R.
17
18> #### Testfile for pwaldtest()
19> #
20> # see also tests/test_pwaldtest_vcovG_attr_cluster.R for the attribute 'cluster' of the furnished vcovs
21> options(scipen = 999)
22> options(digits = 8)
23> library(plm)
24> data("Grunfeld", package="plm")
25> gp <- plm(inv ~ value + capital, data = Grunfeld, model = "pooling")
26> gi <- plm(inv ~ value + capital, data = Grunfeld,
27+           effect = "individual", model = "within")
28> gt <- plm(inv ~ value + capital, data = Grunfeld,
29+           effect = "time", model = "within")
30> gd <- plm(inv ~ value + capital, data = Grunfeld,
31+           effect = "twoways", model = "within")
32> gre<- plm(inv ~ value + capital, data = Grunfeld,
33+           effect = "individual", model = "random")
34>
35> # Chisq
36> plm::pwaldtest(gp, test = "Chisq")
37
38	Wald test for joint significance
39
40data:  inv ~ value + capital
41Chisq = 853.151, df = 2, p-value < 0.000000000000000222
42alternative hypothesis: at least one coefficient is not null
43
44> plm::pwaldtest(gi, test = "Chisq")
45
46	Wald test for joint significance
47
48data:  inv ~ value + capital
49Chisq = 618.028, df = 2, p-value < 0.000000000000000222
50alternative hypothesis: at least one coefficient is not null
51
52> plm::pwaldtest(gt, test = "Chisq")
53
54	Wald test for joint significance
55
56data:  inv ~ value + capital
57Chisq = 729.289, df = 2, p-value < 0.000000000000000222
58alternative hypothesis: at least one coefficient is not null
59
60> plm::pwaldtest(gd, test = "Chisq")
61
62	Wald test for joint significance
63
64data:  inv ~ value + capital
65Chisq = 434.885, df = 2, p-value < 0.000000000000000222
66alternative hypothesis: at least one coefficient is not null
67
68> plm::pwaldtest(gre, test = "Chisq")
69
70	Wald test for joint significance
71
72data:  inv ~ value + capital
73Chisq = 657.674, df = 2, p-value < 0.000000000000000222
74alternative hypothesis: at least one coefficient is not null
75
76>
77> # F
78> plm::pwaldtest(gp, test = "F")
79
80	F test for joint significance
81
82data:  inv ~ value + capital
83F = 426.576, df1 = 2, df2 = 197, p-value < 0.000000000000000222
84alternative hypothesis: at least one coefficient is not null
85
86> plm::pwaldtest(gi, test = "F")
87
88	F test for joint significance
89
90data:  inv ~ value + capital
91F = 309.014, df1 = 2, df2 = 188, p-value < 0.000000000000000222
92alternative hypothesis: at least one coefficient is not null
93
94> plm::pwaldtest(gt, test = "F")
95
96	F test for joint significance
97
98data:  inv ~ value + capital
99F = 364.645, df1 = 2, df2 = 178, p-value < 0.000000000000000222
100alternative hypothesis: at least one coefficient is not null
101
102> plm::pwaldtest(gd, test = "F")
103
104	F test for joint significance
105
106data:  inv ~ value + capital
107F = 217.442, df1 = 2, df2 = 169, p-value < 0.000000000000000222
108alternative hypothesis: at least one coefficient is not null
109
110> plm::pwaldtest(gre, test = "F")
111
112	F test for joint significance
113
114data:  inv ~ value + capital
115F = 328.837, df1 = 2, df2 = 197, p-value < 0.000000000000000222
116alternative hypothesis: at least one coefficient is not null
117
118>
119>
120> # Gretl uses Stata's small sample adjustment
121>   g <- pdim(gi)$nT$n # no of individuals
122>   n <- pdim(gi)$nT$N # no of total obs
123>   k <- length(coefficients(gi))
124>   adj_k1 <- (g/(g-1) * (n-1)/(n-k-1)) # k <- k + 1 because Stata and Gretl have the intercept in the FE model
125>   adj    <- (g/(g-1) * (n-1)/(n-k))
126>   adj_gd <- (g/(g-1) * (n-1)/(n-k-1-19)) # Gretl has time dummies, not demeaning by time (20 periods for Grunfeld data)
127> # vcov with adjustment factors
128>   vcov_mat_adj_gp  <- adj_k1  * plm::vcovHC(gp)
129>   vcov_mat_adj_gi  <- adj_k1  * plm::vcovHC(gi)
130>   vcov_mat_adj_gd  <- adj_gd  * plm::vcovHC(gd) # NB: adj_gd to be used here
131>   vcov_mat_adj_gre <- adj_k1  * plm::vcovHC(gre)
132>   vcov_mat_adj_gt  <- adj_k1  * plm::vcovHC(gt)
133>
134> # Chisq - robust - formula
135> plm::pwaldtest(gp, test = "Chisq", vcov = vcovHC)
136
137	Wald test for joint significance (robust), vcov: vcovHC
138
139data:  inv ~ value + capital
140Chisq = 115.81, df = 2, p-value < 0.000000000000000222
141alternative hypothesis: at least one coefficient is not null
142
143> plm::pwaldtest(gi, test = "Chisq", vcov = vcovHC)
144
145	Wald test for joint significance (robust), vcov: vcovHC
146
147data:  inv ~ value + capital
148Chisq = 63.5489, df = 2, p-value = 0.000000000000015869
149alternative hypothesis: at least one coefficient is not null
150
151> plm::pwaldtest(gt, test = "Chisq", vcov = vcovHC)
152
153	Wald test for joint significance (robust), vcov: vcovHC
154
155data:  inv ~ value + capital
156Chisq = 124.216, df = 2, p-value < 0.000000000000000222
157alternative hypothesis: at least one coefficient is not null
158
159> plm::pwaldtest(gd, test = "Chisq", vcov = vcovHC)
160
161	Wald test for joint significance (robust), vcov: vcovHC
162
163data:  inv ~ value + capital
164Chisq = 149.268, df = 2, p-value < 0.000000000000000222
165alternative hypothesis: at least one coefficient is not null
166
167> plm::pwaldtest(gre, test = "Chisq", vcov = vcovHC)
168
169	Wald test for joint significance (robust), vcov: vcovHC
170
171data:  inv ~ value + capital
172Chisq = 78.7096, df = 2, p-value < 0.000000000000000222
173alternative hypothesis: at least one coefficient is not null
174
175>
176> # Chisq - robust - matrix
177> plm::pwaldtest(gp, test = "Chisq", vcov = vcovHC(gp))
178
179	Wald test for joint significance (robust), vcov: vcovHC(gp)
180
181data:  inv ~ value + capital
182Chisq = 115.81, df = 2, p-value < 0.000000000000000222
183alternative hypothesis: at least one coefficient is not null
184
185> plm::pwaldtest(gi, test = "Chisq", vcov = vcovHC(gi))
186
187	Wald test for joint significance (robust), vcov: vcovHC(gi)
188
189data:  inv ~ value + capital
190Chisq = 63.5489, df = 2, p-value = 0.000000000000015869
191alternative hypothesis: at least one coefficient is not null
192
193> plm::pwaldtest(gt, test = "Chisq", vcov = vcovHC(gt))
194
195	Wald test for joint significance (robust), vcov: vcovHC(gt)
196
197data:  inv ~ value + capital
198Chisq = 124.216, df = 2, p-value < 0.000000000000000222
199alternative hypothesis: at least one coefficient is not null
200
201> plm::pwaldtest(gd, test = "Chisq", vcov = vcovHC(gd))
202
203	Wald test for joint significance (robust), vcov: vcovHC(gd)
204
205data:  inv ~ value + capital
206Chisq = 149.268, df = 2, p-value < 0.000000000000000222
207alternative hypothesis: at least one coefficient is not null
208
209> plm::pwaldtest(gre, test = "Chisq", vcov = vcov_mat_adj_gre) # replicates Gretl: Chi-square(2) = 70.1267
210
211	Wald test for joint significance (robust), vcov: vcov_mat_adj_gre
212
213data:  inv ~ value + capital
214Chisq = 70.1267, df = 2, p-value = 0.00000000000000059181
215alternative hypothesis: at least one coefficient is not null
216
217>
218> # F - robust
219> plm::pwaldtest(gp, test = "F", vcov = vcov_mat_adj_gp) # replicates Gretl: F(2, 9) = 51.59060
220
221	F test for joint significance (robust), vcov: vcov_mat_adj_gp
222
223data:  inv ~ value + capital
224F = 51.5906, df1 = 2, df2 = 9, p-value = 0.000011734
225alternative hypothesis: at least one coefficient is not null
226
227> plm::pwaldtest(gi, test = "F", vcov = vcov_mat_adj_gi) # replicates Gretl: F(2, 9) = 28.3096
228
229	F test for joint significance (robust), vcov: vcov_mat_adj_gi
230
231data:  inv ~ value + capital
232F = 28.3096, df1 = 2, df2 = 9, p-value = 0.00013105
233alternative hypothesis: at least one coefficient is not null
234
235> plm::pwaldtest(gi, test = "F", vcov = function(x) vcovHC(x, cluster = "time")) # cluster on time, df2 = 19
236
237	F test for joint significance (robust), vcov: function(x) vcovHC(x,
238	cluster = "time")
239
240data:  inv ~ value + capital
241F = 109.317, df1 = 2, df2 = 19, p-value = 0.00000000003776
242alternative hypothesis: at least one coefficient is not null
243
244> plm::pwaldtest(gt, test = "F", vcov = vcov_mat_adj_gt)
245
246	F test for joint significance (robust), vcov: vcov_mat_adj_gt
247
248data:  inv ~ value + capital
249F = 55.3352, df1 = 2, df2 = 9, p-value = 0.000008773
250alternative hypothesis: at least one coefficient is not null
251
252> plm::pwaldtest(gd, test = "F", vcov = vcov_mat_adj_gd) # replicates Gretl: F(2, 9) = 60.0821
253
254	F test for joint significance (robust), vcov: vcov_mat_adj_gd
255
256data:  inv ~ value + capital
257F = 60.0821, df1 = 2, df2 = 9, p-value = 0.0000062223
258alternative hypothesis: at least one coefficient is not null
259
260> plm::pwaldtest(gre, test = "F", vcov = vcov_mat_adj_gre)
261
262	F test for joint significance (robust), vcov: vcov_mat_adj_gre
263
264data:  inv ~ value + capital
265F = 35.0633, df1 = 2, df2 = 9, p-value = 0.000056447
266alternative hypothesis: at least one coefficient is not null
267
268>
269>
270> # F - robust - matrix
271> plm::pwaldtest(gp, test = "F", vcov = vcovHC(gp))
272
273	F test for joint significance (robust), vcov: vcovHC(gp)
274
275data:  inv ~ value + capital
276F = 57.9049, df1 = 2, df2 = 9, p-value = 0.0000072606
277alternative hypothesis: at least one coefficient is not null
278
279> plm::pwaldtest(gi, test = "F", vcov = vcovHC(gi))
280
281	F test for joint significance (robust), vcov: vcovHC(gi)
282
283data:  inv ~ value + capital
284F = 31.7744, df1 = 2, df2 = 9, p-value = 0.000083417
285alternative hypothesis: at least one coefficient is not null
286
287> plm::pwaldtest(gi, test = "F", vcov = function(x) vcovHC(x, cluster = "time")) # cluster on time, df2 = 19
288
289	F test for joint significance (robust), vcov: function(x) vcovHC(x,
290	cluster = "time")
291
292data:  inv ~ value + capital
293F = 109.317, df1 = 2, df2 = 19, p-value = 0.00000000003776
294alternative hypothesis: at least one coefficient is not null
295
296> plm::pwaldtest(gt, test = "F", vcov = vcovHC(gt))
297
298	F test for joint significance (robust), vcov: vcovHC(gt)
299
300data:  inv ~ value + capital
301F = 62.1078, df1 = 2, df2 = 9, p-value = 0.0000054149
302alternative hypothesis: at least one coefficient is not null
303
304> plm::pwaldtest(gd, test = "F", vcov = vcovHC(gd))
305
306	F test for joint significance (robust), vcov: vcovHC(gd)
307
308data:  inv ~ value + capital
309F = 74.6338, df1 = 2, df2 = 9, p-value = 0.0000024936
310alternative hypothesis: at least one coefficient is not null
311
312> plm::pwaldtest(gre, test = "F", vcov = vcovHC(gre))
313
314	F test for joint significance (robust), vcov: vcovHC(gre)
315
316data:  inv ~ value + capital
317F = 39.3548, df1 = 2, df2 = 9, p-value = 0.000035512
318alternative hypothesis: at least one coefficient is not null
319
320>
321>
322> ############### compare to other statistics packages:
323>
324> ## package 'lfe'
325> # library(lfe)
326> # data("Grunfeld", package = "plm")
327> # gi_lfe <- felm(inv ~ value + capital | firm, data = Grunfeld)
328> # gi_lfe_cluster <- felm(inv ~ value + capital | firm, data = Grunfeld, clustervar="firm")
329> # summary(gi_lfe)
330> # summary(gi_lfe_cluster)
331> # lfe::waldtest(gi_lfe, R = names(coef(gi_lfe))) # df1 = 2, df2 = 188
332> # lfe::waldtest(gi_lfe_cluster, R = names(coef(gi_lfe_cluster))) # chi2: 54.03250, F. 27.01625, df1 = 2, df2 = 9
333> # gi_lfe_cluster$clustervcv #  # this vcov is not identical to vcovHC, so results do not match
334>
335>
336> ### Stata ####
337> # See http://www.stata.com/manuals14/xtxtreg.pdf
338> # example 2 vs. example 3 (p 14 and 16):
339> # F(8, 23386) = 610.12 - normal
340> # F(8, 4696)  = 273.86 - robust
341>
342> # commented because it needs extra library 'foreign'
343> # library(plm)
344> # library(haven)
345> # nlswork <- read_dta("http://www.stata-press.com/data/r14/nlswork.dta") # large file
346> # nlswork$race <- factor(nlswork$race) # convert
347> # nlswork$race2 <- factor(ifelse(nlswork$race == 2, 1, 0)) # need this variable for example
348> # nlswork$grade <- as.numeric(nlswork$grade)
349> # pnlswork <- pdata.frame(nlswork, index=c("idcode", "year"), drop.index=F)
350> #
351> # form_nls_ex2 <- formula(ln_wage ~ grade + age + I(age^2) + ttl_exp + I(ttl_exp^2) + tenure + I(tenure^2) + race2 + not_smsa + south)
352> # plm_fe_nlswork <- plm(form_nls_ex2, data = pnlswork, model = "within")
353> #
354> # plm:::pwaldtest(plm_fe_nlswork, test = "F")                 # replicates Stata: F(8, 23386) = 610.12 - normal
355> # plm:::pwaldtest(plm_fe_nlswork, test = "F", vcov = vcovHC) # replicates Stata: F(8, 4696)  = 273.86 - robust
356>
357>
358>
359> ### replicate Gretl ####
360> # library(foreign);library(plm)
361> # wagepan<-read.dta("http://fmwww.bc.edu/ec-p/data/wooldridge/wagepan.dta")
362> # pwagepan <- pdata.frame(wagepan, index = c("nr", "year"))
363> # pdim(pwagepan)
364> #
365> # mod_fe_ind <- plm(lwage ~ exper + hours + married + expersq, data = pwagepan, model = "within", effect = "individual")
366> #
367> # plm:::pwaldtest(mod_fe_ind, test="F")
368> # plm:::pwaldtest(mod_fe_ind, test="F", vcov = function(x) vcovHC(x)) # 121.4972
369> #
370> # # Gretl uses Stata's small sample adjustment
371> # g <- pdim(mod_fe_ind)$nT$n # no of individuals
372> # n <- pdim(mod_fe_ind)$nT$N # no of total obs
373> # k <- length(coefficients(mod_fe_ind))
374> # k <- k+1 # + 1 because Stata and Gretl have the intercept in the FE model
375> # adj <- (g/(g-1) * (n-1)/(n-k))
376> # vcov_mat_adj <- adj * plm::vcovHC(mod_fe_ind)
377> # print(plm:::pwaldtest(mod_fe_ind, test="F", vcov = vcov_mat_adj), digits = 12) # replicate Gretl: F(4, 544) = 121.163
378>
379>
380> # Reference: Gretl (2016b)
381> #
382> # Gretl, wagepan data, fixed effects (oneway, HAC SEs)
383> # Model 1: Fixed-effects, using 4360 observations
384> # Included 545 cross-sectional units
385> # Time-series length = 8
386> # Dependent variable: lwage
387> # Robust (HAC) standard errors
388> #
389> #              coefficient    std. error    t-ratio    p-value
390> #   -----------------------------------------------------------
391> #   const       1.30069       0.0550817     23.61     2.15e-085 ***
392> #   exper       0.137331      0.0108430     12.67     2.12e-032 ***
393> #   hours      −0.000136467   2.13715e-05   −6.385    3.67e-010 ***
394> #   married     0.0481248     0.0213232      2.257    0.0244    **
395> #   expersq    −0.00532076    0.000692182   −7.687    7.09e-014 ***
396> #
397> # Mean dependent var   1.649147   S.D. dependent var   0.532609
398> # Sum squared resid    459.8591   S.E. of regression   0.347371
399> # LSDV R-squared       0.628105   Within R-squared     0.196125
400> # Log-likelihood      −1283.082   Akaike criterion     3664.165
401> # Schwarz criterion    7166.910   Hannan-Quinn         4900.376
402> # rho                  0.065436   Durbin-Watson        1.546260
403> #
404> # Joint test on named regressors -
405> #   Test statistic: F(4, 544) = 121.163
406> #   with p-value = P(F(4, 544) > 121.163) = 7.19472e-074
407> #
408> # Robust test for differing group intercepts -
409> #   Null hypothesis: The groups have a common intercept
410> #   Test statistic: Welch F(544, 1276.3) = 26.9623
411> #   with p-value = P(F(544, 1276.3) > 26.9623) = 0
412>
413>
414>
415> # Model 1: Fixed-effects, using 200 observations
416> # Included 10 cross-sectional units
417> # Time-series length = 20
418> # Dependent variable: inv
419> # Robust (HAC) standard errors
420> #
421> #              coefficient   std. error   t-ratio   p-value
422> #   --------------------------------------------------------
423> #   const      −58.7439      27.6029      −2.128    0.0622   *
424> #   value        0.110124     0.0151945    7.248    4.83e-05 ***
425> #   capital      0.310065     0.0527518    5.878    0.0002   ***
426> #
427> # Mean dependent var   145.9582   S.D. dependent var   216.8753
428> # Sum squared resid    523478.1   S.E. of regression   52.76797
429> # LSDV R-squared       0.944073   Within R-squared     0.766758
430> # Log-likelihood      −1070.781   Akaike criterion     2165.562
431> # Schwarz criterion    2205.142   Hannan-Quinn         2181.579
432> # rho                  0.663920   Durbin-Watson        0.684480
433> #
434> # Joint test on named regressors -
435> #   Test statistic: F(2, 9) = 28.3096
436> #   with p-value = P(F(2, 9) > 28.3096) = 0.000131055
437> #
438> # Robust test for differing group intercepts -
439> #   Null hypothesis: The groups have a common intercept
440> #   Test statistic: Welch F(9, 70.6) = 85.9578
441> #   with p-value = P(F(9, 70.6) > 85.9578) = 1.90087e-034
442>
443>
444> # Model 6: Fixed-effects, using 200 observations
445> # Included 10 cross-sectional units
446> # Time-series length = 20
447> # Dependent variable: inv
448> # Robust (HAC) standard errors
449> #
450> #              coefficient   std. error   t-ratio   p-value
451> #   --------------------------------------------------------
452> #   const      −32.8363      19.7826      −1.660    0.1313
453> #   value        0.117716     0.0108244   10.88     1.77e-06 ***
454> #   capital      0.357916     0.0478484    7.480    3.77e-05 ***
455> #   dt_2       −19.1974      20.6986      −0.9275   0.3779
456> #   dt_3       −40.6900      33.2832      −1.223    0.2526
457> #   dt_4       −39.2264      15.7365      −2.493    0.0343   **
458> #   dt_5       −69.4703      26.9988      −2.573    0.0300   **
459> #   dt_6       −44.2351      17.3723      −2.546    0.0314   **
460> #   dt_7       −18.8045      17.8475      −1.054    0.3195
461> #   dt_8       −21.1398      14.1648      −1.492    0.1698
462> #   dt_9       −42.9776      12.5441      −3.426    0.0076   ***
463> #   dt_10      −43.0988      10.9959      −3.920    0.0035   ***
464> #   dt_11      −55.6830      15.2019      −3.663    0.0052   ***
465> #   dt_12      −31.1693      20.9169      −1.490    0.1704
466> #   dt_13      −39.3922      26.4371      −1.490    0.1704
467> #   dt_14      −43.7165      38.8786      −1.124    0.2899
468> #   dt_15      −73.4951      38.2545      −1.921    0.0869   *
469> #   dt_16      −75.8961      36.7985      −2.062    0.0692   *
470> #   dt_17      −62.4809      49.4181      −1.264    0.2379
471> #   dt_18      −64.6323      51.5621      −1.253    0.2416
472> #   dt_19      −67.7180      43.7447      −1.548    0.1560
473> #   dt_20      −93.5262      31.7263      −2.948    0.0163   **
474> #
475> # Mean dependent var   145.9582   S.D. dependent var   216.8753
476> # Sum squared resid    452147.1   S.E. of regression   51.72452
477> # LSDV R-squared       0.951693   Within R-squared     0.798540
478> # Log-likelihood      −1056.132   Akaike criterion     2174.264
479> # Schwarz criterion    2276.512   Hannan-Quinn         2215.643
480> # rho                  0.658860   Durbin-Watson        0.686728
481> #
482> # Joint test on named regressors -
483> #   Test statistic: F(2, 9) = 60.0821
484> #   with p-value = P(F(2, 9) > 60.0821) = 6.22231e-006
485> #
486> # Robust test for differing group intercepts -
487> #   Null hypothesis: The groups have a common intercept
488> #   Test statistic: Welch F(9, 76.7) = 53.1255
489> #   with p-value = P(F(9, 76.7) > 53.1255) = 2.45306e-029
490>
491>
492>
493> # Model 5: Pooled OLS, using 200 observations
494> # Included 10 cross-sectional units
495> # Time-series length = 20
496> # Dependent variable: inv
497> # Robust (HAC) standard errors
498> #
499> #              coefficient   std. error   t-ratio   p-value
500> #   --------------------------------------------------------
501> #   const      −42.7144      20.4252      −2.091    0.0660   *
502> #   value        0.115562     0.0158943    7.271    4.71e-05 ***
503> #   capital      0.230678     0.0849671    2.715    0.0238   **
504> #
505> # Mean dependent var   145.9582   S.D. dependent var   216.8753
506> # Sum squared resid     1755850   S.E. of regression   94.40840
507> # R-squared            0.812408   Adjusted R-squared   0.810504
508> # F(2, 9)              51.59060   P-value(F)           0.000012
509> # Log-likelihood      −1191.802   Akaike criterion     2389.605
510> # Schwarz criterion    2399.500   Hannan-Quinn         2393.609
511> # rho                  0.956242   Durbin-Watson        0.209717
512>
513>
514> # Model 2: Random-effects (GLS), using 200 observations
515> # Included 10 cross-sectional units
516> # Time-series length = 20
517> # Dependent variable: inv
518> # Robust (HAC) standard errors
519> #
520> #              coefficient   std. error     z       p-value
521> #   --------------------------------------------------------
522> #   const      −57.8344      24.8432      −2.328   0.0199    **
523> #   value        0.109781     0.0137557    7.981   1.45e-015 ***
524> #   capital      0.308113     0.0549728    5.605   2.08e-08  ***
525> #
526> # Mean dependent var   145.9582   S.D. dependent var   216.8753
527> # Sum squared resid     1841062   S.E. of regression   96.42765
528> # Log-likelihood      −1196.541   Akaike criterion     2399.083
529> # Schwarz criterion    2408.978   Hannan-Quinn         2403.087
530> #
531> # 'Between' variance = 7089.8
532> # 'Within' variance = 2784.46
533> # theta used for quasi-demeaning = 0.861224
534> # corr(y,yhat)^2 = 0.806104
535> #
536> # Joint test on named regressors -
537> #   Asymptotic test statistic: Chi-square(2) = 70.1267
538> #   with p-value = 5.91814e-016
539> #
540> # Breusch-Pagan test -
541> #   Null hypothesis: Variance of the unit-specific error = 0
542> #   Asymptotic test statistic: Chi-square(1) = 798.162
543> #   with p-value = 1.35448e-175
544> #
545> # Hausman test -
546> #   Null hypothesis: GLS estimates are consistent
547> #   Asymptotic test statistic: Chi-square(2) = 7.31971
548> #   with p-value = 0.0257363
549>
550>
551>
552> proc.time()
553   user  system elapsed
554   0.79    0.18    0.96
555