Michael Perdue Michael Perdue - 27 days ago 9
R Question

R: Diagnostic Tests on Panel Regression

I have the following data that I am running panel regression on. I would like to test for unit root using

plm
's
purtest
:

date years_exp cid cfcontrol leg_totalbills state amtsumlag_1 amtsumfwd_1 billsumfwd_1 billsum amtsum unemplag_1 logleg_totalbills logamtsumlag_1 logamtsumfwd_1 logamtsum exp_5_9 exp_10_19 exp20 post2009years amtsum_5to9exp amtsum_10to19exp amtsum_exp20 amtsumlag1_5to9exp amtsumlag1_10to19exp amtsumlag1_exp20 amtsumfwd1_5to9exp amtsumfwd1_10to19exp amtsumfwd1_exp20 amtsum_post2009years amtsumfwd1_post2009years amtsumlag1_post2009years logamtsum_5to9exp logamtsum_10to19exp logamtsum_exp20 logamtsumlag1_5to9exp logamtsumlag1_10to19exp logamtsumlag1_exp20 logamtsumfwd1_5to9exp logamtsumfwd1_10to19exp logamtsumfwd1_exp20 logamtsum_post2009years logamtsumfwd1_post2009years logamtsumlag1_post2009years
1 2006 18 N00007665 0 2 HI 309 376.54 1 0 286.139 2.9 0.6931472 5.733341 5.931024 5.656478 0 1 0 2006 0 286.139 0 0 309 0 0 376.54 0 573994.8 755339.2 619854 0 5.656478 0 0 5.733341 0 0 5.931024 0 11346.89 11897.63 11501.08
2 2008 20 N00007665 0 2 HI 376.54 13.66 2 0 334.095 2.8 0.6931472 5.931024 2.614472 5.811425 0 0 1 2008 0 0 334.095 0 0 376.54 0 0 13.66 670862.8 27429.28 756092.3 0 0 5.811425 0 0 5.931024 0 0 2.614472 11669.34 5249.859 11909.5
3 2006 24 N00001143 0 2 NY 124.763 140.755 1 0 197.874 5 0.6931472 4.826416 4.947021 5.28763 0 0 1 2006 0 0 197.874 0 0 124.763 0 0 140.755 396935.2 282354.5 250274.6 0 0 5.28763 0 0 4.826416 0 0 4.947021 10606.99 9923.724 9681.79
4 2008 26 N00001143 0 22 NY 140.755 151.65 0 0 243.545 4.6 3.091042 4.947021 5.021575 5.495302 0 0 1 2008 0 0 243.545 0 0 140.755 0 0 151.65 489038.4 304513.2 282636 0 0 5.495302 0 0 4.947021 0 0 5.021575 11034.57 10083.32 9933.618
5 2010 28 N00001143 0 9 NY 151.65 138.25 0 0 194.317 8.3 2.197225 5.021575 4.929064 5.269491 0 0 1 1 0 0 194.317 0 0 151.65 0 0 138.25 194.317 138.25 151.65 0 0 5.269491 0 0 5.021575 0 0 4.929064 5.269491 4.929064 5.021575


I run the following code for unit root using the
hadri, madwu, ips, and levinlin
tests. :

purtest(billsum~trend, data = femodel_1, index=c('date', 'cid'), pmax = 2, exo = "trend", test = "hadri")


and get the following error:

Error in data.frame(
2005
= structure(c(333L, 333L, 55L, 55L, 55L, 55L, : arguments imply differing number of rows: 51, 378, 41, 439, 63, 438, 42, 432, 93, 441


Does anyone have an idea of what might be the problem?

Answer

The Hadri LM test for panel unit roots is not applicable to unbalanced panels.

Comments