Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • XTTEST4: Stata module to calculate heteroskedasticity tests for fixed-T panel data models

    Hello everyone,

    I'd like to introduce a new STATA command called xttest4, now available on SSC. Thanks to Prof. Kit Baum.
    Code:
    ssc install xttest4, replace
    xttest4 provides heteroskedasticity tests for fixed-T panel data models
    • For fixed-effects models (FEM), xttest4 performs tests based on the artificial regression proposed by Juhl & Sosa-Escudero (2014). This includes two tests with alternative hypotheses corresponding to heteroskedasticity in cross-section units and heteroskedasticity in cross-section units and/or periods. When option kezdi is specified, xttest4 reports the test statistics proposed by Kezdi (2003), providing information on selecting the appropriate standard error form for FEM.
    • For Random-effects models (REM), xttest4 performs tests based on the artificial regression proposed by Montes-Rosa & Sosa-Escudero (2011). Where, marginal and joint test statistics for homogeneity of error components are reported along with degrees of freedom and p-value.
    Here are some examples:

    Code:
    . webuse abdata, clear
    
    . qui xtreg n k w ys if id <=100, fe
    
    . xttest4
    
    Test for heteroscedasticity in fixed-T panel data models
    Model: Fixed-effects
    H0:    Var(e_it  X_i, u_i) = sigma^2
    
    H1                Statistic     df    P-value
    
    sigma_it^2           16.125      3      0.001
    sigma_i^2            10.294      3      0.016
    
    
    . qui xtreg n k w ys, fe
    
    . xttest4, kezdi
    
    Test for heteroscedasticity in fixed-T panel data models
    
    Hypothesis         Statistic    df     P-value
    
    H2 vs. Ha           26.734      7      0.000
    H3 vs. Ha           24.862      7      0.001
    
    H1 is missing due to unbalanced data
    H2: Serially uncorrelated: e_it, x_it or both
    H3: Homoskedasticity and serially uncorrelated
    Ha: Heteroskedasticity
    
    
    . qui xtreg n c.(k w ys)##c.(k w ys), re
    
    . xttest4
    
    Test for heteroscedasticity in fixed-T panel data models
    Model: Random-effects
    H1:    Var(u_i + e_it  X_i) = sigma_it^2
    
    Null hypothesis (H0)    Statistic     df    P-value
    
    sigma_e^2  sigma_u^2     200.213      9      0.000
    sigma_u^2  sigma_e^2      11.991      9      0.214
    sigma_e^2 & sigma_u^2     212.204     18      0.000

    Manh Hoang-Ba,
    Facebook,
    Eureka! Uni - YouTube,
    ManhHB94 (Manh Hoang Ba),
    Hoàng Bá Mạnh – Kinh tế lượng: Lý thuyết và ứng dụng

  • #2
    xttest4 has been updated to fix a calculation error in the LM2 (system homoscedastic case) statistic.
    Users should run the following command to update.
    Code:
    ado update xttest4, update
    Manh Hoang-Ba,
    Facebook,
    Eureka! Uni - YouTube,
    ManhHB94 (Manh Hoang Ba),
    Hoàng Bá Mạnh – Kinh tế lượng: Lý thuyết và ứng dụng

    Comment


    • #3
      Thanks to prof. KitBaum , xttest4 version 2.0 has been updated on SSC.
      Code:
      ssc install xttest4 , replace
      Where:
      1. all heavy computations are done in Mata.
      2. singularity of C_j is decided by rank() instead of det()==0.
      3. Kezdi test: df = rank of C_j (= K(K+1)/2 when C_j is nonsingular), NOT K(K+1)/2+1 as printed in Kezdi (2004). Also correct when regressors are omitted, N < K(K+1)/2, or C_j is null (H2 with T = 2).
      4. Kezdi test: C2 uses the same T_i/(T_i-1) scaling as V2, so the influence function of H2 has mean zero under H0.
      Code:
      . webuse abdata, clear
      
      . qui xtreg n l(0/1).(k w ys) i.year, fe
      
      . xttest4
      
      Test for heteroscedasticity in fixed-T panel data models
      Model: Fixed-effects
      H0:    Var(e_it | X_i, u_i) = sigma^2
      --------------------------------------------------
      H1                Statistic     df    P-value
      --------------------------------------------------
      sigma_it^2           51.210     13      0.000
      sigma_i^2            85.289     13      0.000
      --------------------------------------------------
      
      . xttest4 , kezdi
      
      Test for heteroscedasticity in fixed-T panel data models
      Covariance matrix C2 is singular. Use generalized inverse.
      --------------------------------------------------
      Hypothesis         Statistic    df     P-value
      --------------------------------------------------
       H2 vs. Ha          112.053     90      0.058
       H3 vs. Ha          139.678     91      0.001
      --------------------------------------------------
      H1 is missing due to unbalanced data
      H2: Serially uncorrelated: e_it, x_it or both
      H3: Homoskedasticity and serially uncorrelated
      Ha: Heteroskedasticity
      Manh Hoang-Ba,
      Facebook,
      Eureka! Uni - YouTube,
      ManhHB94 (Manh Hoang Ba),
      Hoàng Bá Mạnh – Kinh tế lượng: Lý thuyết và ứng dụng

      Comment

      Working...
      X