Skip to contents

The `nemoment()` function enables to implement the naive estimation of the moments of the heterogeneous mean, the heterogeneous autocovariance, and the heterogeneous autocorrelation. The method is developed by Okui and Yanagi (2019). For more details, see the package vignette with `vignette("panelhetero")`.

Usage

nemoment(data, acov_order = 0, acor_order = 1, R = 1000)

Arguments

data

A matrix of panel data. Each row corresponds to individual time series.

acov_order

A non-negative integer of the order of autocovariance. Default is 0.

acor_order

A positive integer of the order of autocorrelation Default is 1.

R

A positive integer of the number of bootstrap repetitions. Default is 1000.

Value

A list that contains the following elements.

estimate

A vector of the parameter estimates

se

A vector of the standard errors

ci

A matrix of the 95 percent confidence intervals

quantity

A matrix of the estimated heterogeneous quantities

acov_order

The order of autocovariance

acor_order

The order of autocovariance

N

The number of cross-sectional units

S

The length of time series

R

The number of bootstrap repetitions

References

Okui, R. and Yanagi, T., 2019. Panel data analysis with heterogeneous dynamics. Journal of Econometrics, 212(2), pp.451-475.

Examples

data <- panelhetero::simulation(N = 300, S = 50)
panelhetero::nemoment(data = data)
#> $estimate
#>         E(mean)         E(acov)         E(acor)       var(mean)       var(acov) 
#>      0.02773033      0.36672021      0.23542132      0.94487588      0.05446876 
#>       var(acor) cor(mean, acov) cor(mean, acor) cor(acov, acor) 
#>      0.03942097     -0.04080153      0.06470255     -0.40705653 
#> 
#> $se
#>         E(mean)         E(acov)         E(acor)       var(mean)       var(acov) 
#>     0.057879139     0.013972353     0.011460515     0.082897878     0.008345571 
#>       var(acor) cor(mean, acov) cor(mean, acor) cor(acov, acor) 
#>     0.002913500     0.053104173     0.056285350     0.040293749 
#> 
#> $ci
#>                 95% CI lower 95% CI upper
#> E(mean)          -0.07822877   0.14942051
#> E(acov)           0.34123733   0.39595060
#> E(acor)           0.21236814   0.25647109
#> var(mean)         0.79403120   1.10676591
#> var(acov)         0.03964418   0.07175545
#> var(acor)         0.03382352   0.04509123
#> cor(mean, acov)  -0.15327752   0.05612278
#> cor(mean, acor)  -0.04924577   0.16870097
#> cor(acov, acor)  -0.47899350  -0.32566513
#> 
#> $quantity
#>                mean autocovariance autocorrelation
#>   [1,]  0.129103585     0.44981269     0.088569728
#>   [2,] -0.769100789     0.25327651     0.261659340
#>   [3,]  1.256193088     0.08541086     0.232608313
#>   [4,]  0.320570669     0.34035575     0.150068074
#>   [5,]  0.327741445     0.29705207     0.189273459
#>   [6,]  0.211282373     0.42263921     0.123911598
#>   [7,] -0.728331222     0.27027640     0.471899236
#>   [8,]  1.161347614     0.25532745     0.168879550
#>   [9,] -0.112372010     0.30824637     0.188582226
#>  [10,] -1.532125225     0.20866796     0.369540592
#>  [11,] -0.809799547     0.24574260     0.054639474
#>  [12,] -0.228909439     0.11748945     0.387964528
#>  [13,] -0.783950671     0.62023360    -0.026157118
#>  [14,]  0.159091508     0.20204247     0.414695420
#>  [15,]  0.332041836     0.30566147    -0.084128041
#>  [16,] -1.401101666     0.74312073     0.188396241
#>  [17,] -1.650543016     0.14205092     0.519413934
#>  [18,] -2.175166579     0.18650044     0.279772032
#>  [19,] -0.370552812     0.22653352     0.421707785
#>  [20,] -0.547767335     0.12946241     0.386338144
#>  [21,]  1.690999620     0.43944619     0.458994415
#>  [22,] -0.417880748     0.23126249     0.029760743
#>  [23,] -1.088096076     0.55722704     0.220350644
#>  [24,]  1.984270543     0.89021558     0.064993255
#>  [25,]  0.067471613     0.42808510     0.095378056
#>  [26,] -0.106417390     0.17565276     0.064472134
#>  [27,] -1.107248770     0.58076366     0.223904848
#>  [28,] -1.704916495     0.34739071     0.229253441
#>  [29,] -0.493081439     0.45527890     0.240021703
#>  [30,] -1.324837524     0.37204072     0.363148900
#>  [31,] -0.285528357     0.37573017     0.337438324
#>  [32,]  1.088001546     0.72802652    -0.036273213
#>  [33,]  0.975654634     0.46409385     0.337415859
#>  [34,]  0.329830464     0.15637403     0.331447999
#>  [35,]  1.431816726     0.18028910     0.272430679
#>  [36,] -0.705330285     1.01161580     0.252775975
#>  [37,]  0.291013776     0.55194056     0.223000421
#>  [38,]  0.130555568     0.45808774     0.336102009
#>  [39,]  0.729997819     0.14328970     0.560392205
#>  [40,] -0.563916213     0.15555760     0.454186942
#>  [41,]  0.854285966     0.11346312     0.470593278
#>  [42,]  0.475819161     0.09775463     0.506195801
#>  [43,] -1.206969989     0.36876215     0.185233436
#>  [44,] -0.518140963     0.35490653     0.125965218
#>  [45,]  1.001665324     0.16874554     0.673182784
#>  [46,] -0.473754617     0.31903579     0.040780139
#>  [47,]  0.653560742     0.08962631     0.624914410
#>  [48,]  0.469433327     0.46415471     0.007954846
#>  [49,]  0.634882173     0.68760373     0.094244776
#>  [50,] -1.656325898     0.25292624     0.166145633
#>  [51,]  1.554918199     0.28764173     0.222454937
#>  [52,]  0.248655915     0.21772968     0.045857789
#>  [53,] -0.330936033     0.31646826     0.169054372
#>  [54,]  0.394291023     0.45075805     0.324877309
#>  [55,]  1.718090015     0.14828846     0.042081296
#>  [56,]  0.034779123     0.10810281     0.644267239
#>  [57,] -0.386736005     0.30369162     0.506938894
#>  [58,]  0.110323498     0.22483953     0.410495321
#>  [59,]  0.620819881     0.29626735     0.182053652
#>  [60,]  0.830726348     0.18365290     0.298783262
#>  [61,] -0.696815562     0.11955271     0.404045314
#>  [62,]  0.657144671     0.17184901     0.258329498
#>  [63,] -1.139004720     0.33766952    -0.162444909
#>  [64,] -0.634410131     0.18618572     0.336113876
#>  [65,] -0.120427021     0.86112603    -0.112511101
#>  [66,] -0.333319780     0.24378031     0.449428796
#>  [67,]  0.599252976     0.21507386     0.529342020
#>  [68,]  0.608021246     0.16423324     0.482022664
#>  [69,]  0.919670087     0.35429678     0.374054760
#>  [70,] -0.523293160     0.53132858    -0.068048358
#>  [71,] -0.244998605     0.31318344     0.258225417
#>  [72,]  0.458538753     0.29789006     0.058580498
#>  [73,]  0.694034274     0.95610171     0.075631580
#>  [74,] -0.927666219     0.31824512     0.420074433
#>  [75,] -0.343739937     0.30717035     0.263089073
#>  [76,] -0.970955546     0.30445280     0.111729379
#>  [77,]  0.054110060     0.17533872     0.561270449
#>  [78,] -0.821983893     0.40115154     0.103378077
#>  [79,] -0.015366297     0.35207877     0.057625359
#>  [80,] -0.578295817     0.28816749     0.444750606
#>  [81,]  0.788462121     0.16516949     0.253915923
#>  [82,]  2.324892095     0.25870868     0.248399179
#>  [83,] -0.447303561     0.34081585     0.140648370
#>  [84,]  0.185395919     0.29067626    -0.094569524
#>  [85,]  0.152857818     0.42663937     0.185284416
#>  [86,] -0.722390858     0.54420647     0.126789963
#>  [87,]  0.864451430     0.26785808     0.404582587
#>  [88,]  1.750918470     0.15387377     0.003242460
#>  [89,] -0.003735891     0.73601123     0.276217195
#>  [90,]  1.255579182     0.65350140     0.063637164
#>  [91,] -1.136153858     0.37407877     0.334411364
#>  [92,]  0.519660227     0.61142264     0.185261295
#>  [93,] -0.251422819     0.38675749     0.080095117
#>  [94,]  0.088545810     0.55971921     0.062630178
#>  [95,]  0.067840014     0.41829505     0.228183654
#>  [96,]  0.799201266     0.65926460     0.107600519
#>  [97,] -0.948302280     0.69520189     0.220491737
#>  [98,]  1.727085673     0.14995117     0.593134813
#>  [99,]  1.056882006     0.49706158     0.214046597
#> [100,]  1.776487123     0.33667074     0.192744438
#> [101,]  0.275426152     0.16098714     0.196910582
#> [102,] -1.081438910     0.11772387     0.631827901
#> [103,]  0.299811691     0.66325185     0.154822180
#> [104,] -0.335074123     0.44255162     0.038848950
#> [105,] -0.343959875     0.36381385     0.323854858
#> [106,]  2.282295795     0.23294301     0.059983452
#> [107,]  0.527501405     0.48098337     0.213295424
#> [108,]  0.924563531     0.42813999     0.342286928
#> [109,]  0.073428195     1.79661732    -0.168112310
#> [110,] -0.178633417     0.78956668     0.087514779
#> [111,]  0.749504561     0.20820979     0.407953827
#> [112,] -2.013606882     0.24385724     0.119385893
#> [113,]  2.761607959     0.48243221     0.232580583
#> [114,]  0.487197086     0.71946205     0.056358904
#> [115,]  0.655818526     0.52785804    -0.088006423
#> [116,]  1.112314142     0.46583087     0.109174784
#> [117,] -0.692166154     0.48280475     0.439893884
#> [118,] -0.858039304     0.26026784     0.627068365
#> [119,] -0.508923251     0.09319110     0.594318755
#> [120,] -0.469293305     0.13403019     0.469506997
#> [121,]  0.181067355     0.49574721     0.186819534
#> [122,]  0.377810037     0.20782062     0.099486436
#> [123,] -0.277774856     0.25821349     0.506514677
#> [124,] -0.335686949     1.09024207     0.176720873
#> [125,]  0.672968923     0.44760372    -0.015043833
#> [126,] -2.260027815     0.09200335     0.295649899
#> [127,] -0.625353381     0.45469168     0.479630102
#> [128,]  1.316080120     0.21559915     0.464307143
#> [129,]  2.367897186     0.12096016     0.362262131
#> [130,] -0.209504554     0.38534974     0.096769636
#> [131,] -0.823988533     0.16164708     0.194652370
#> [132,] -1.636571130     0.58560230     0.255129277
#> [133,] -2.347788524     0.43336525     0.059779763
#> [134,]  0.540247938     0.77046371     0.006879617
#> [135,]  0.006819186     0.23730431     0.088233032
#> [136,]  1.272162660     0.76619358     0.227938925
#> [137,]  0.237301460     0.45956148     0.202670732
#> [138,]  0.633664595     0.16582878     0.209609706
#> [139,]  0.083702002     1.24277959    -0.015248085
#> [140,] -0.181020357     0.17220739     0.317842243
#> [141,] -0.452403128     0.23731802     0.182409780
#> [142,]  1.326888745     0.46464556     0.241968617
#> [143,] -1.761706288     0.36777106     0.293673232
#> [144,] -0.648697022     0.32752068     0.313797178
#> [145,] -0.324535279     0.24727381     0.552433310
#> [146,]  1.134678480     0.63088455     0.201313373
#> [147,]  1.059977316     0.51230648     0.097795055
#> [148,]  0.494124940     0.43063542     0.100743426
#> [149,]  0.196087195     0.55868468     0.479842721
#> [150,]  0.741299118     0.18023752     0.069300700
#> [151,]  1.334556224     0.23501686     0.070754967
#> [152,]  0.172934987     0.80132387     0.105955505
#> [153,]  2.550046794     0.32347831     0.586575191
#> [154,] -0.054273323     0.64304533     0.175915081
#> [155,]  0.424726276     0.37225593     0.056998929
#> [156,]  0.425758524     0.13509575     0.675824237
#> [157,] -0.285114396     0.16415728     0.631524420
#> [158,]  0.789432522     0.11197017     0.053337962
#> [159,]  1.289014085     0.94926124     0.194619664
#> [160,] -2.249936832     0.63802876     0.341733512
#> [161,]  0.573994304     0.42914607     0.260923460
#> [162,]  0.239331010     0.25182879     0.332996291
#> [163,] -1.334343800     0.22375299     0.247457481
#> [164,]  1.570077728     0.17759908     0.285208488
#> [165,] -0.125338584     0.12950417     0.302973053
#> [166,] -0.419578000     0.89287129     0.354520303
#> [167,]  0.581505371     0.27865532    -0.009966739
#> [168,] -1.135884786     0.39596045     0.047802958
#> [169,]  0.389531809     0.11072973     0.291564091
#> [170,] -0.093757539     0.19323192     0.470736385
#> [171,]  0.094775639     0.38368244    -0.014230593
#> [172,] -0.657832071     0.17692146     0.202142152
#> [173,]  0.029590370     0.25523816     0.397063672
#> [174,]  0.589414638     0.23267980     0.340014888
#> [175,] -0.425202218     0.22172242     0.165702939
#> [176,]  0.732120686     0.19174492     0.237335737
#> [177,] -0.597656700     0.41790424     0.169091955
#> [178,]  0.410868642     0.89606628     0.331632181
#> [179,]  0.543426184     0.28755318    -0.079462621
#> [180,] -1.817195828     0.59531670     0.372668885
#> [181,]  1.867689960     0.57380858     0.255800478
#> [182,] -3.083404293     0.50639230    -0.013129208
#> [183,]  0.452099019     0.71377467     0.020228966
#> [184,] -0.991587227     0.41275142    -0.061266964
#> [185,] -1.756972309     0.25592712     0.055954754
#> [186,]  0.484733700     0.23642264     0.327215427
#> [187,]  0.473225264     0.45543455    -0.011180497
#> [188,] -0.318914788     0.24207096     0.124981910
#> [189,] -0.558654280     0.25664130     0.285230615
#> [190,]  1.097663427     0.74277990     0.238562179
#> [191,] -0.492733130     0.40849650     0.146767799
#> [192,] -0.790618115     0.46640129     0.331078887
#> [193,] -0.127484559     0.18339500     0.358264367
#> [194,]  0.243074763     0.65984614     0.153057096
#> [195,] -0.375083204     0.10329278     0.003740640
#> [196,]  0.611572103     0.18937554     0.802291057
#> [197,] -2.001491743     0.31024684    -0.044840669
#> [198,] -0.548088180     0.16864478     0.518162240
#> [199,]  1.406556812     0.29467598     0.597603543
#> [200,] -1.066351420     0.29455194    -0.015187530
#> [201,] -1.279610540     0.37787453    -0.148776549
#> [202,] -0.877944316     0.26749964     0.114292084
#> [203,]  0.133891240     0.76041518     0.087538309
#> [204,]  0.944227371     0.28564997     0.464471415
#> [205,]  0.215810152     0.48948712     0.342391788
#> [206,] -0.594108408     0.15867750     0.429177636
#> [207,]  0.474721370     0.20198398     0.373968824
#> [208,]  0.286570258     0.18902179     0.115223554
#> [209,] -0.413786835     0.29105890     0.082696838
#> [210,] -0.930927118     0.07486284     0.614999412
#> [211,] -0.468522158     0.03364258     0.458216433
#> [212,] -0.339106326     0.26157421     0.356095619
#> [213,]  0.109402188     0.32676737     0.298207590
#> [214,]  1.739794486     0.30170552     0.094339562
#> [215,] -0.408103637     0.39280197     0.256184530
#> [216,] -1.503514625     0.27791637     0.434343433
#> [217,]  0.338281975     0.22486968     0.096973467
#> [218,] -0.932899527     0.42703290    -0.035791549
#> [219,] -1.385137472     0.68122927     0.353099346
#> [220,]  0.839021468     0.12179593     0.726697313
#> [221,] -0.447571316     0.10847701     0.285639956
#> [222,] -1.271937348     0.34595852    -0.145907357
#> [223,]  0.942638366     0.14486445    -0.067260613
#> [224,]  0.101322160     0.26324980     0.229939737
#> [225,] -1.133663951     0.11422629     0.445553064
#> [226,]  0.546540962     0.43308986     0.338110476
#> [227,] -1.008938215     0.91424574     0.005619856
#> [228,] -0.202384375     0.70087901    -0.134201469
#> [229,]  0.663590305     0.09253755     0.304358909
#> [230,] -1.260935451     0.37376134     0.287858570
#> [231,]  0.364671212     0.33990708     0.258458941
#> [232,]  0.749543376     0.40255173     0.447046368
#> [233,] -1.311997371     0.24166674     0.349430155
#> [234,]  0.619629419     0.22426897     0.170279468
#> [235,]  0.030312874     0.43044844     0.061258391
#> [236,] -0.098089618     0.56789487     0.411885651
#> [237,]  0.733107081     0.13725038     0.330142524
#> [238,]  0.046300953     0.22620430     0.498905859
#> [239,] -1.344305657     0.51802907     0.171397995
#> [240,] -1.101864606     0.23188450     0.230346918
#> [241,]  0.712626849     0.28028670     0.644853042
#> [242,] -1.461997463     0.49624217    -0.064423384
#> [243,] -0.936124928     0.30612974     0.288453415
#> [244,]  0.789384674     0.25761077     0.362036207
#> [245,]  2.144243897     0.09466908     0.249224299
#> [246,] -0.980934640     0.48840426     0.205903322
#> [247,]  0.233104566     0.37533291    -0.174272683
#> [248,]  0.849610765     0.43983410     0.215728313
#> [249,]  0.220009759     0.21134338     0.034917950
#> [250,]  0.347673773     0.08775809     0.502113255
#> [251,]  1.066586659     0.24719660     0.424530500
#> [252,]  0.812185798     0.15404680     0.312761766
#> [253,]  0.458356422     0.98050253     0.124591504
#> [254,] -0.386501887     0.14385969     0.343683383
#> [255,]  0.426149982     0.35897763     0.098146681
#> [256,]  0.140341756     0.18182648     0.323435743
#> [257,] -1.173993765     0.23134375     0.206310229
#> [258,]  0.138955777     0.27250235     0.136909180
#> [259,] -1.606223571     0.39785279     0.038942218
#> [260,]  0.194719791     0.96299924     0.082327836
#> [261,]  1.668079317     0.39266550     0.006908224
#> [262,]  0.880172426     0.41427199    -0.260626310
#> [263,]  1.749265303     0.45611225    -0.179602483
#> [264,]  1.101300104     0.11533019     0.535142019
#> [265,]  0.654596098     0.30676187     0.575647087
#> [266,] -2.697186716     0.55805027     0.395179485
#> [267,] -0.559115016     0.46224953     0.153446891
#> [268,] -1.460337920     1.02931090    -0.290007208
#> [269,]  0.538970459     0.18005760     0.486880720
#> [270,] -0.540981445     0.36525493     0.007847028
#> [271,] -0.599050450     0.21939588     0.270827291
#> [272,] -0.975188333     0.35726477    -0.024927826
#> [273,] -0.131410720     0.13339424     0.304332915
#> [274,]  0.225233058     0.16199264     0.134308406
#> [275,]  0.610306026     0.18053608     0.424802732
#> [276,]  0.267987628     0.37238944     0.155044618
#> [277,]  0.648769841     0.37134818     0.181694764
#> [278,]  0.790556213     0.20162933     0.545107421
#> [279,]  0.385256354     0.34205643     0.257245322
#> [280,]  0.739263138     0.47595107     0.393592703
#> [281,]  0.519273947     0.24052656     0.326106715
#> [282,]  0.201219499     1.08511952     0.133774419
#> [283,] -0.245457078     0.37529931     0.572952873
#> [284,]  0.889911278     0.36090001    -0.129165229
#> [285,]  1.146618624     0.57609614     0.114066302
#> [286,] -1.665418803     0.23460354     0.305609554
#> [287,]  0.667078576     0.38262739    -0.034391240
#> [288,]  0.377713209     0.33093261     0.343325670
#> [289,]  0.036960378     0.09092704     0.492342800
#> [290,]  2.630737031     0.14204965     0.322558809
#> [291,] -0.632910376     0.10065942     0.240527487
#> [292,] -1.095977129     0.50537457    -0.092194041
#> [293,] -0.160720726     0.25361076     0.325667862
#> [294,] -0.103478542     0.42358984     0.030999215
#> [295,]  0.712385986     0.33154299     0.603095276
#> [296,] -0.795629068     0.74414311    -0.059039356
#> [297,] -0.683787016     0.11287672     0.397514618
#> [298,]  0.929793495     0.16419301     0.210168265
#> [299,]  0.249405823     0.16576636     0.191025166
#> [300,]  0.767572080     0.57611202     0.392781995
#> 
#> $acov_order
#> [1] 0
#> 
#> $acor_order
#> [1] 1
#> 
#> $N
#> [1] 300
#> 
#> $S
#> [1] 50
#> 
#> $R
#> [1] 1000
#>