Announcement

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

  • P-values become insignificant when st errors are clustered

    Dear StataList Members,

    Here is my data and I am running cox proportional hazard model using the code. When I do not cluster st errors, the p-values corresponding to the following variables are significant: ideal_distance ideal_larger_zero d_dist_exceed. However, when I cluster them, they lose their significance. Why is that the case? Thank you in advance.

    stcox i.male ideal_distance ideal_larger_zero d_dist_exceed mother_age mother_age_sqr i.survey_year i.SEDUC i.rural_urban i.wealth_index i.quarter_of_birth if B0_01==0, robust cluster(CASEID) nohr

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(male ideal_distance ideal_larger_zero d_dist_exceed mother_age mother_age_sqr survey_year) double SEDUC float(rural_urban wealth_index quarter_of_birth) double B0_01 byte(_st _d) double _t byte _t0 str15 CASEID float age_months_new
    1  0 1 0 36 1296 2008 3 1 5 1 0 1 0   .5 0 "       10110  2"   .5
    1  0 1 0 36 1296 2008 3 1 5 1 0 1 0  1.5 0 "       10110  2"  1.5
    1  0 1 0 36 1296 2008 3 1 5 1 0 1 0  2.5 0 "       10110  2"  2.5
    1  0 1 0 36 1296 2008 3 1 5 1 0 1 0  3.5 0 "       10110  2"  3.5
    1  0 1 0 36 1296 2008 3 1 5 1 0 1 0  4.5 0 "       10110  2"  4.5
    1  0 1 0 36 1296 2008 3 1 5 1 0 1 0  5.5 0 "       10110  2"  5.5
    1  0 1 0 36 1296 2008 3 1 5 1 0 1 0  6.5 0 "       10110  2"  6.5
    1  0 1 0 36 1296 2008 3 1 5 1 0 1 0  7.5 0 "       10110  2"  7.5
    1  0 1 0 36 1296 2008 3 1 5 1 0 1 0  8.5 0 "       10110  2"  8.5
    1  0 1 0 36 1296 2008 3 1 5 1 0 1 0  9.5 0 "       10110  2"  9.5
    1  0 1 0 36 1296 2008 3 1 5 1 0 1 0 10.5 0 "       10110  2" 10.5
    1  0 1 0 36 1296 2008 3 1 5 1 0 1 0 11.5 0 "       10110  2" 11.5
    1  0 1 0 36 1296 2008 3 1 5 1 0 1 0 12.5 0 "       10110  2" 12.5
    1  0 1 0 36 1296 2008 3 1 5 1 0 1 0 13.5 0 "       10110  2" 13.5
    1  0 1 0 36 1296 2008 3 1 5 1 0 1 0 14.5 0 "       10110  2" 14.5
    1  0 1 0 36 1296 2008 3 1 5 1 0 1 0 15.5 0 "       10110  2" 15.5
    1  0 1 0 36 1296 2008 3 1 5 1 0 1 0 16.5 0 "       10110  2" 16.5
    1  0 1 0 36 1296 2008 3 1 5 1 0 1 0 17.5 0 "       10110  2" 17.5
    1  0 1 0 36 1296 2008 3 1 5 1 0 1 0 18.5 0 "       10110  2" 18.5
    1  0 1 0 36 1296 2008 3 1 5 1 0 1 0 19.5 0 "       10110  2" 19.5
    1  0 1 0 36 1296 2008 3 1 5 1 0 1 0 20.5 0 "       10110  2" 20.5
    1  0 1 0 36 1296 2008 3 1 5 1 0 1 1 21.5 0 "       10110  2" 21.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 0   .5 0 "       102 3  2"   .5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 0  1.5 0 "       102 3  2"  1.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 0  2.5 0 "       102 3  2"  2.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 0  3.5 0 "       102 3  2"  3.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 0  4.5 0 "       102 3  2"  4.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 0  5.5 0 "       102 3  2"  5.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 0  6.5 0 "       102 3  2"  6.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 0  7.5 0 "       102 3  2"  7.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 0  8.5 0 "       102 3  2"  8.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 0  9.5 0 "       102 3  2"  9.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 0 10.5 0 "       102 3  2" 10.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 0 11.5 0 "       102 3  2" 11.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 0 12.5 0 "       102 3  2" 12.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 0 13.5 0 "       102 3  2" 13.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 0 14.5 0 "       102 3  2" 14.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 0 15.5 0 "       102 3  2" 15.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 0 16.5 0 "       102 3  2" 16.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 0 17.5 0 "       102 3  2" 17.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 18.5 0 "       102 3  2" 18.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 19.5 0 "       102 3  2" 19.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 20.5 0 "       102 3  2" 20.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 21.5 0 "       102 3  2" 21.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 22.5 0 "       102 3  2" 22.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 23.5 0 "       102 3  2" 23.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 24.5 0 "       102 3  2" 24.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 25.5 0 "       102 3  2" 25.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 26.5 0 "       102 3  2" 26.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 27.5 0 "       102 3  2" 27.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 28.5 0 "       102 3  2" 28.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 29.5 0 "       102 3  2" 29.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 30.5 0 "       102 3  2" 30.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 31.5 0 "       102 3  2" 31.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 32.5 0 "       102 3  2" 32.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 33.5 0 "       102 3  2" 33.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 34.5 0 "       102 3  2" 34.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 35.5 0 "       102 3  2" 35.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 36.5 0 "       102 3  2" 36.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 37.5 0 "       102 3  2" 37.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 38.5 0 "       102 3  2" 38.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 39.5 0 "       102 3  2" 39.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 40.5 0 "       102 3  2" 40.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 41.5 0 "       102 3  2" 41.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 42.5 0 "       102 3  2" 42.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 43.5 0 "       102 3  2" 43.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 44.5 0 "       102 3  2" 44.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 45.5 0 "       102 3  2" 45.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 46.5 0 "       102 3  2" 46.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 47.5 0 "       102 3  2" 47.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 48.5 0 "       102 3  2" 48.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 49.5 0 "       102 3  2" 49.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 50.5 0 "       102 3  2" 50.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 51.5 0 "       102 3  2" 51.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 52.5 0 "       102 3  2" 52.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 53.5 0 "       102 3  2" 53.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 54.5 0 "       102 3  2" 54.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 55.5 0 "       102 3  2" 55.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 56.5 0 "       102 3  2" 56.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 57.5 0 "       102 3  2" 57.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 58.5 0 "       102 3  2" 58.5
    1  0 1 0 32 1024 2008 1 1 2 4 0 1 1 59.5 0 "       102 3  2" 59.5
    0 -1 0 0 37 1369 2008 3 1 4 2 0 1 0   .5 0 "       10217  1"   .5
    0 -1 0 0 37 1369 2008 3 1 4 2 0 1 0  1.5 0 "       10217  1"  1.5
    0 -1 0 0 37 1369 2008 3 1 4 2 0 1 0  2.5 0 "       10217  1"  2.5
    0 -1 0 0 37 1369 2008 3 1 4 2 0 1 0  3.5 0 "       10217  1"  3.5
    0 -1 0 0 37 1369 2008 3 1 4 2 0 1 0  4.5 0 "       10217  1"  4.5
    0 -1 0 0 37 1369 2008 3 1 4 2 0 1 0  5.5 0 "       10217  1"  5.5
    0 -1 0 0 37 1369 2008 3 1 4 2 0 1 0  6.5 0 "       10217  1"  6.5
    0 -1 0 0 37 1369 2008 3 1 4 2 0 1 0  7.5 0 "       10217  1"  7.5
    0 -1 0 0 37 1369 2008 3 1 4 2 0 1 0  8.5 0 "       10217  1"  8.5
    0 -1 0 0 37 1369 2008 3 1 4 2 0 1 0  9.5 0 "       10217  1"  9.5
    0 -1 0 0 37 1369 2008 3 1 4 2 0 1 0 10.5 0 "       10217  1" 10.5
    0 -1 0 0 37 1369 2008 3 1 4 2 0 1 0 11.5 0 "       10217  1" 11.5
    0 -1 0 0 37 1369 2008 3 1 4 2 0 1 0 12.5 0 "       10217  1" 12.5
    0 -1 0 0 37 1369 2008 3 1 4 2 0 1 0 13.5 0 "       10217  1" 13.5
    0 -1 0 0 37 1369 2008 3 1 4 2 0 1 0 14.5 0 "       10217  1" 14.5
    0 -1 0 0 37 1369 2008 3 1 4 2 0 1 0 15.5 0 "       10217  1" 15.5
    0 -1 0 0 37 1369 2008 3 1 4 2 0 1 0 16.5 0 "       10217  1" 16.5
    0 -1 0 0 37 1369 2008 3 1 4 2 0 1 0 17.5 0 "       10217  1" 17.5
    end
    label values male male
    label def male 0 "Female", modify
    label def male 1 "Male", modify
    label values SEDUC SEDUC
    label def SEDUC 1 "Complete primary", modify
    label def SEDUC 3 "Complete high school / higher", modify
    label values rural_urban rural_urban
    label def rural_urban 1 "Urban", modify
    label values wealth_index wealth_index
    label def wealth_index 2 "Poorer", modify
    label def wealth_index 4 "Rich", modify
    label def wealth_index 5 "Richest", modify
    label values B0_01 B0_01
    label def B0_01 0 "Single birth", modify

  • #2
    Hi Cansu,

    This shouldn't be a surprise, "normal" standard errors (in Stata) don't account for the fact that data comes from individual units which are repeated over times (the cluster), instead treating each observation as iid whereas using clustered standard errors takes into account the fact that units are clustered and thus adjusts the standard errors appropriately. I am not sure if this is a general rule but in my experience clustered standard errors are nearly always less than or equal to "normal" standard errors.

    best,
    Rhys

    Comment


    • #3
      What Rhys said but in slightly different words:

      If you have N independent observations, you have N independent observations.

      If your N observations are independent across C clusters, but are correlated within the clusters, then you do not have N observations anymore. If observations were perfectly correlated within the clusters, you would have C observations. If they are imperfectly correlated, you have more than C effective observations, but still less than N.

      So you could think of this expected result as a manifestation of the fact that you have smaller effective sample.

      Comment

      Working...
      X