Announcement

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

  • iebaltab for balancing table - r(2000) no observation error

    Hi,


    I am creating a balanced table using the iebaltab command in Stata SE 19.5. I get a "no observations r(2000) error" when I run the code. Could someone please help me with this? Thank you.

    I have kept all variables that are all numerical, and have at least 150 observations with these two sets of commands:

    Code:
    * prepare data for balanced table 
    * identify and remove the stirng variables from data set for the iebaltab command
    ds, has(type string)
    drop `r(varlist)' // 425 => 422 variables
    
    
    * identify variables that have at least 150 observations to use them for the balancing tables: 422 => 272
    ds
    foreach v of varlist `r(varlist)' {
        quietly count if !missing(`v')
        local n = r(N)
        if `n' < 150 {
            drop `v'
        }
    }

    This is the error message I get when running the code:

    Code:
    . iebaltab a1 a2 a3 a4 a5 a6 a8 a9_usedseed  a12_hectare a12b a13a a13_prod wtrial_yield wtrial_seedpr
    > od a14 a15_1 a15_2 a15_3 a15_4 a15_5 a16 a17 a18 a19 a20, grpvar(treatment) savexlsx("$out_path\bala
    > ncetable_phone_survey_HT.xls")  feqtest vce(cluster kebele) stats(feq(p)) rowvarlabel replace
    
    no observations
    r(2000);
    
    end of do-file
    
    r(2000);


    And this is the dataex sample of the data:

    Code:
    . dataex treatment kebele a1 a2 a3 a4 a5 a6 a8 a9_usedseed  a12_hectare a12b a13a a13_prod wtrial_yiel
    > d wtrial_seedprod a14 a15_1 a15_2 a15_3 a15_4 a15_5 a16 a17 a18 a19 a20
    
    ----------------------- copy starting from the next line -----------------------
    
    
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float treatment int kebele byte(a1 a2 a3) float a4 byte(a5 a6 a8) float(a9_usedseed a12_hectare) byte a12b float(a13a a13_prod wtrial_yield wtrial_seedprod) byte(a14 a15_1 a15_2 a15_3 a15_4 a15_5 a16 a17 a18 a19 a20)
    0 1207 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 1207 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 1207 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 1207 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 1208 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 1208 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 1207 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 2204 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 2210 1 1 1     0 1 1 1 3     .0024 1   10   10  41.66666 .033333335 1 0 1 0 0 0 3 4 4 4 4
    0 2211 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 2211 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 2213 1 1 1    50 1 1 1 3        .1 1  100  100        10   .3333333 1 1 1 1 0 0 3 4 3 2 1
    2 2213 1 1 1    70 1 1 1 3       .05 1   60   60        12         .2 1 1 1 0 0 0 1 3 3 2 1
    0 3515 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 3515 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 3515 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 3515 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 3515 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 2204 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 3406 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 3406 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 3406 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 3406 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 3406 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 3406 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 3112 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 3112 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 3112 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 3112 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    1 3124 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    1 3124 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    1 3124 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 2119 1 1 1     0 1 1 1 3    .03125 1 23.5 23.5      7.52  .07833333 1 1 0 0 0 0 1 2 2 2 1
    2 2119 1 1 1     0 1 1 1 3    .03125 1   15   15       4.8        .05 1 1 0 0 0 0 1 3 3 1 2
    0 2120 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 2120 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 2120 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 2121 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 2121 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 2121 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 2121 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 2121 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 3312 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 3312 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 1101 1 1 1    65 1 1 1 3      .025 1 37.5 37.5        15       .125 1 1 0 0 0 0 1 1 1 1 1
    1 1107 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    1 1107 1 1 2    50 1 1 1 3      .015 1   20   20 13.333334  .06666667 1 1 0 0 0 0 1 1 1 1 1
    1 1107 1 1 2    30 1 1 1 3      .015 0    .   30        20         .1 1 0 1 0 0 0 4 4 4 2 4
    1 1107 1 1 2 26.66 1 1 1 3       .01 1   96   96        96        .32 1 1 0 0 0 0 4 2 1 1 1
    1 3311 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    1 3311 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 3312 1 1 1    80 1 1 1 3      .005 1   40   30        40  .13333334 1 1 0 0 0 0 2 4 3 2 2
    2 3312 1 1 1    50 1 1 1 3       .04 1   50   50      1250  .16666667 1 1 1 0 0 0 2 2 3 2 2
    2 3312 1 1 1    65 1 1 1 3     .0025 1   30   30       4.8         .1 1 0 1 0 0 0 1 3 3 2 1
    2 3312 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 3312 1 1 2    80 1 1 1 3      .125 0    .   50     .0625  .16666667 1 1 1 0 0 0 1 2 2 1 1
    1 3605 1 1 1    75 1 1 1 3     .0625 1   50   50         8  .16666667 1 1 1 0 0 0 2 2 3 2 2
    1 3605 1 3 1    60 1 1 1 3     .0625 1   35   35       5.6  .11666667 4 1 0 0 0 0 2 2 3 2 2
    1 3605 1 1 1    75 1 1 1 3     .0625 1   60   60       9.6         .2 1 1 1 0 0 0 2 2 2 2 2
    1 3605 1 3 1    60 1 1 1 3       .06 1   60   60        10         .2 3 1 0 0 0 0 1 3 3 2 2
    1 3606 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    1 3606 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    1 3606 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    1 3606 1 3 1     0 1 1 1 3    .09375 1   65   65  6.933333  .21666667 1 1 0 0 0 0 3 2 3 2 2
    1 3606 1 1 1    50 1 1 1 3     .0625 1   50   50         8  .16666667 1 1 0 0 0 0 4 3 2 4 2
    1 3606 1 1 1    30 1 1 1 3       .06 1   30   30         5         .1 1 1 0 0 0 0 2 2 4 4 2
    2 2213 1 1 1    50 1 1 1 3       .05 1   20   20         4  .06666667 1 0 1 0 0 0 2 3 2 1 1
    0 2212 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 3212 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 3212 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 1208 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 1208 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 1208 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 3209 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    1 3210 1 1 1     0 1 1 1 3 .03333333 1   20   20         6  .06666667 1 1 1 0 0 0 4 3 4 2 2
    1 3210 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    1 3210 1 1 1     0 1 1 1 3       .03 1  100  100 33.333332   .3333333 1 1 1 0 0 0 2 2 3 2 2
    2 3211 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    1 3210 1 1 1     0 1 1 1 3      .005 1   10   10        20 .033333335 1 1 0 0 0 0 4 4 2 2 2
    2 3211 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 3211 1 1 1    60 1 1 1 3      .025 0    .   90        36         .3 1 1 1 0 1 0 2 2 2 2 2
    2 3211 1 1 1    40 1 1 1 3      .025 1   90   90        36         .3 1 1 0 0 0 0 2 3 3 1 2
    0 3212 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 3212 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 3212 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    0 3212 . . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 3211 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 3601 1 1 1     0 1 1 1 3      .125 1   30   30       2.4         .1 1 1 0 0 0 0 3 2 3 2 2
    2 3601 1 1 1     0 1 1 1 3      .125 1   30   30       2.4         .1 1 1 1 0 0 0 1 2 3 1 1
    2 3601 1 1 1     0 1 1 1 3     .0625 1   10   10       1.6 .033333335 1 1 0 0 0 0 3 3 3 1 2
    2 3601 1 1 1     0 1 1 1 3     .0625 1   60   60       9.6         .2 3 1 0 0 0 0 3 3 3 2 2
    2 3601 1 1 1     0 1 1 1 3     .0625 1   30   30       4.8         .1 1 1 1 0 0 0 2 4 2 2 2
    2 3602 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 3602 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 3602 1 1 1    50 1 1 1 3      .125 1   75   75         6        .25 1 1 1 0 0 0 3 3 3 4 2
    2 3602 1 3 1    60 1 1 1 3     .0625 1   36   36      5.76        .12 4 1 1 0 0 0 2 2 2 2 2
    2 3602 1 1 1    45 1 1 1 3     .0625 1  100  100        16   .3333333 1 0 1 0 0 0 2 2 2 1 1
    2 3602 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 3602 0 . .     . . . . .         . .    .    .         .          . . . . . . . . . . . .
    2 3602 1 1 1    50 1 1 1 3     .0625 1   20   20       3.2  .06666667 1 1 1 0 0 0 2 2 2 2 2
    end
    label values kebele kebele
    label def kebele 1101 "Adisalem", modify
    label def kebele 1107 "Lul", modify
    label def kebele 1207 "Yedwuha", modify
    label def kebele 1208 "Yeju", modify
    label def kebele 2119 "Amisetya", modify
    label def kebele 2120 "Aquha", modify
    label def kebele 2121 "Niquara", modify
    label def kebele 2204 "Estifanos", modify
    label def kebele 2210 "Tara Gedam", modify
    label def kebele 2211 "Tibaga", modify
    label def kebele 2212 "Wusha Tires", modify
    label def kebele 2213 "Yifag Akababi", modify
    label def kebele 3112 "Abil_Abu", modify
    label def kebele 3124 "Woreke abu", modify
    label def kebele 3209 "Boren", modify
    label def kebele 3210 "Ejerti", modify
    label def kebele 3211 "Ketary", modify
    label def kebele 3212 "Tulumojo", modify
    label def kebele 3311 "Mukiche", modify
    label def kebele 3312 "Shafie", modify
    label def kebele 3406 "Wonzegir", modify
    label def kebele 3515 "Debeke", modify
    label def kebele 3601 "Debre Nigist", modify
    label def kebele 3602 "Degnu", modify
    label def kebele 3605 "Kuntit", modify
    label def kebele 3606 "Yebelo", modify
    label values a1 a1
    label def a1 0 "No", modify
    label def a1 1 "Yes", modify
    label values a2 a2
    label def a2 1 "Respondent", modify
    label def a2 3 "Someone else in the household", modify
    label values a3 a3
    label def a3 1 "Daka", modify
    label def a3 2 "Others, specify", modify
    label values a5 a5
    label def a5 1 "Yes", modify
    label values a6 a6
    label def a6 1 "Kept and planted separately", modify
    label values a8 a8
    label def a8 1 "Yes, all of it (3kg)", modify
    label values a12b a12b
    label def a12b 0 "No, harvested together", modify
    label def a12b 1 "Yes, harvested separately", modify
    label values a14 a14
    label def a14 1 "Respondent", modify
    label def a14 3 "Someone else in the household (female)", modify
    label def a14 4 "Someone else in the household (male)", modify
    label values a15_1 yesno
    label values a15_2 yesno
    label values a15_3 yesno
    label values a15_4 yesno
    label values a15_5 yesno
    label def yesno 0 "No", modify
    label def yesno 1 "Yes", modify
    label values a16 a16
    label def a16 1 "Much higher than expected", modify
    label def a16 2 "Higher than expected", modify
    label def a16 3 "As expected", modify
    label def a16 4 "Lower than expected", modify
    label values a17 a17
    label def a17 1 "Much higher than expected", modify
    label def a17 2 "Higher than expected", modify
    label def a17 3 "As expected", modify
    label def a17 4 "Lower than expected", modify
    label values a18 a18
    label def a18 1 "Much higher than expected", modify
    label def a18 2 "Higher than expected", modify
    label def a18 3 "As expected", modify
    label def a18 4 "Lower than expected", modify
    label values a19 a19
    label def a19 1 "Very much satisfied", modify
    label def a19 2 "Satisfied", modify
    label def a19 4 "Not satisfied", modify
    label values a20 a20
    label def a20 1 "Very much satisfied", modify
    label def a20 2 "Satisfied", modify
    label def a20 4 "Not satisfied", modify
    ------------------ copy up to and including the previous line ------------------


  • #2
    This is probably due to the missingness in your data for specific values of the treatment variable. At least in the data extract, there are for instance no non-missing values of any of the a* variables when treatment == 0. Of course, I don't know if this is also true in your full dataset.

    Also, as you are asked to specify in the forum FAQ #12, iebaltab is a community-contributed command that is part of the ietoolkit package available via
    Code:
    net describe ietoolkit, from(http://fmwww.bc.edu/RePEc/bocode/i)
    Last edited by Hemanshu Kumar; 05 Sep 2025, 16:55.

    Comment


    • #3
      Originally posted by Hemanshu Kumar View Post
      This is probably due to the missingness in your data for specific values of the treatment variable. At least in the data extract, there are for instance no non-missing values of any of the a* variables when treatment == 0. Of course, I don't know if this is also true in your full dataset.

      Also, as you are asked to specify in the forum FAQ #12, iebaltab is a community-contributed command that is part of the ietoolkit package available via
      Code:
      net describe ietoolkit, from(http://fmwww.bc.edu/RePEc/bocode/i)
      I think you are right. When I conditioned the command on treatment>0, it worked perfectly. Thank you so much.

      Comment

      Working...
      X