Announcement

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

  • using weights in descriptive statistics

    Hello,

    I was showing a table with immigrants share in each occupation for the year 2004, 2009 and 2014. However, in year 2009, there was in each occupation a quite increase in immigrants share in 2014 a decrease. Immigrants share in 2004 and 2014 looks similar. Looking deeper to the data, the high increase in immigrants share in 2009 was to the data sample (to less natives compared to 2004 and 2014).

    Now I was thinking about that I should weight these data (got a variable for weighting extrapolation).

    Tef1=occupation, year=2004,2009,2014, is051 (is051==1 is immigrant, 0 native), ixpxhj= weighting extrapolation variable


    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int tef1 float year byte is051 float ixpxhj
    4 2004 0 .
    2 2004 0 .
    1 2004 0 .
    2 2004 0 .
    2 2004 0 .
    9 2004 1 .
    1 2004 0 .
    2 2004 0 .
    6 2004 1 .
    7 2004 0 .
    7 2004 1 .
    7 2004 0 .
    5 2004 0 .
    3 2004 0 .
    8 2004 0 .
    2 2004 0 .
    3 2004 0 .
    2 2004 0 .
    7 2004 1 .
    9 2004 1 .
    7 2004 1 .
    7 2004 1 .
    7 2004 0 .
    3 2004 0 .
    3 2004 0 .
    1 2004 0 .
    1 2004 0 .
    4 2004 0 .
    1 2004 1 .
    6 2004 1 .
    7 2004 0 .
    1 2004 0 .
    4 2004 0 .
    3 2004 0 .
    7 2004 0 .
    3 2004 0 .
    7 2004 0 .
    5 2004 0 .
    1 2004 1 .
    7 2004 0 .
    5 2004 1 .
    2 2004 0 .
    5 2004 0 .
    9 2004 0 .
    7 2004 0 .
    4 2004 0 .
    2 2004 1 .
    7 2004 1 .
    1 2004 1 .
    7 2004 1 .
    2 2004 0 .
    7 2004 0 .
    5 2004 0 .
    4 2004 1 .
    2 2004 0 .
    3 2004 0 .
    3 2004 0 .
    7 2004 0 .
    2 2004 1 .
    1 2004 0 .
    3 2004 1 .
    3 2004 1 .
    1 2004 1 .
    7 2004 1 .
    5 2004 0 .
    7 2004 1 .
    8 2004 1 .
    1 2004 0 .
    7 2004 1 .
    7 2004 0 .
    7 2004 0 .
    5 2004 0 .
    2 2004 1 .
    1 2004 0 .
    5 2004 1 .
    7 2004 0 .
    4 2004 0 .
    8 2004 0 .
    5 2004 1 .
    3 2004 0 .
    1 2004 0 .
    7 2004 1 .
    2 2004 0 .
    7 2004 0 .
    3 2004 0 .
    3 2004 0 .
    8 2004 0 .
    3 2004 0 .
    6 2004 1 .
    5 2004 0 .
    7 2004 0 .
    4 2004 0 .
    7 2004 0 .
    2 2004 0 .
    5 2004 0 .
    3 2004 1 .
    9 2004 1 .
    7 2004 1 .
    8 2004 1 .
    2 2004 0 .
    end
    label values tef1 TEF1D
    label def TEF1D 1 "1.F�hrungskr�fte", modify
    label def TEF1D 2 "2.Akademische Berufe", modify
    label def TEF1D 3 "3.Techniker und gleichrangige Berufe", modify
    label def TEF1D 4 "4.B�rokr�fte und verwandte Berufe", modify
    label def TEF1D 5 "5.Dienstleistungsberufe und Verk�ufer", modify
    label def TEF1D 6 "6.Fachkr�fte in Land- und Forstwirtschaft", modify
    label def TEF1D 7 "7.Handwerks- und verwandte Berufe", modify
    label def TEF1D 8 "8.Anlagen und Maschinenbediener, Montierer", modify
    label def TEF1D 9 "9.Hilfsarbeitskr�fte", modify
    label values is051 is051l
    label def is051l 0 "native", modify
    label def is051l 1 "foreign", modify
    label values ixpxhj IXPXHJD
    Without weighting, I used the following code to show the table:
    Code:
    tab tef1 year, sum(is051)
    
    Means, Standard Deviations and    Frequencies    of Heimat
    
    BERUFSHAUP
    TGRUPPEN:              year
    ISCO-08       2004       2009    2014      Total
            
    1.F�hrung  .30549451  .47830688    .32420382  .36175182
    .46086985   .4997937    .46822574  .48057765
    910        945    1570       3425
            
    2.Akademi  .29806181  .40615058    .32005793  .33841696
    .45752664  .49124357    .46658297  .47320722
    1909       1886    2762       6557
            
    3.Technik  .21546635  .29616725    .20846466  .23420561
    .41126688  .45672483    .40630219  .42354087
    1694       1435    2221       5350
            
    4.B�rokr�  .23460026  .28144989    .18779343   .2303581
    .42402668   .4501866    .39085308  .42117461
    763        469    639       1871
            
    5.Dienstl  .39184953  .42969777    .33421284  .37898424
    .48841862   .4953585    .47192213  .48521918
    957        761    1137       2855
            
    6.Fachkr�  .40677966  .42857143    .375         .4
    .49332793  .49761335    .48591266  .49060949
    118         91    136        345
            
    7.Handwer  .42863616  .45416913    .31840077  .39755608
    .49499315  .49804239    .46596814  .48943369
    2207       1691    2076       5974
            
    8.Anlagen         .5  .54531722    .40371846  .48113626
    .5002986  .49831863    .49096841  .49975495
    838        662    753       2253
            
    9.Hilfsar  .69433962   .7260274    .53191489  .65090403
    .46155825  .44701684    .50004546  .47701619
    265        219    235        719
            
    Total  .34810061  .42027209    .30332206  .35057413
    .47639277  .49363278    .45971308   .4771579
    9661       8159    11529
    I thought of generating a new variable where is051 is weighted like
    Code:
    gen pop = ixpxhj*is051
    tab tef1 year, sum(pop)
    However, I loose many observation....
    Last edited by Anshul Anand; 04 Oct 2018, 05:40.

  • #2
    Sorry, ignore the post above please since it is very unclear.

    So, I have something like the following table where tef1 is occupations, year=2004,2009,2014 and is051==1 immigrant and is051==native. The following table shows the immigrant share in each occupation for these years.
    Code:
    tab tef1 year, sum(is051)
    
    Means, Standard Deviations and Frequencies of    Heimat
    
    BERUFSHAUP
    TGRUPPEN:              year
    ISCO-08       2004       2009       2014      Total
    
    1.F�hrung  .30549451  .47830688  .32420382  .36175182
    .46086985   .4997937  .46822574  .48057765
    910        945       1570       3425
    
    2.Akademi  .29806181  .40615058  .32005793  .33841696
    .45752664  .49124357  .46658297  .47320722
    1909       1886       2762       6557
    
    3.Technik  .21546635  .29616725  .20846466  .23420561
    .41126688  .45672483  .40630219  .42354087
    1694       1435       2221       5350
    
    4.B�rokr�  .23460026  .28144989  .18779343   .2303581
    .42402668   .4501866  .39085308  .42117461
    763        469        639       1871
    
    5.Dienstl  .39184953  .42969777  .33421284  .37898424
    .48841862   .4953585  .47192213  .48521918
    957        761       1137       2855
    
    6.Fachkr�  .40677966  .42857143       .375         .4
    .49332793  .49761335  .48591266  .49060949
    118         91        136        345
    
    7.Handwer  .42863616  .45416913  .31840077  .39755608
    .49499315  .49804239  .46596814  .48943369
    2207       1691       2076       5974
    
    8.Anlagen         .5  .54531722  .40371846  .48113626
    .5002986  .49831863  .49096841  .49975495
    838        662        753       2253
    
    9.Hilfsar  .69433962   .7260274  .53191489  .65090403
    .46155825  .44701684  .50004546  .47701619
    265        219        235        719
    
    Total  .34810061  .42027209  .30332206  .35057413
    .47639277  .49363278  .45971308   .4771579
    9661       8159      11529      29349
    However, I would like to use the weighting variable in the dataset, which is named as ixpxh. But I don't get it, how this works. I was only able to make something like this:
    Code:
    tab    year is051 [iweight=ixpxh]
    
        Heimat
        year     native      Total
        
        2004  961,475.6  1177884.7
        2009  946,502.5  1204061.6
        2014 940,013.55  1247095.6
        
        Total  2847991.7  3629041.9
    
    
        Heimat
        year    foreign      Total
        
        2004  216,409.1  1177884.7
        2009  257,559.1  1204061.6
        2014  307,082.1  1247095.6
        
        Total  781,050.2  3629041.9
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int tef1 float year byte is051 double ixpxh
    5 2014 0 157.46160888671875
    2 2014 0  285.3028259277344
    5 2009 0         58.2965586
    7 2004 0         56.1433624
    9 2014 0  30.84276580810547
    9 2014 0 49.258296966552734
    7 2014 0  63.85438919067383
    7 2004 0         69.9250869
    7 2004 0        200.7211601
    7 2009 0          81.923775
    6 2004 0         36.0033301
    5 2014 0  54.32048034667969
    4 2004 0         38.8134996
    7 2009 0        262.1809652
    7 2014 0 63.084468841552734
    2 2004 0         42.6520668
    5 2014 0  303.2359924316406
    6 2004 0        165.4179866
    7 2009 0         74.1005676
    8 2009 0         43.0859673
    4 2014 0 288.62652587890625
    5 2014 0    302.82470703125
    5 2004 0         78.0995611
    5 2004 0        117.5195342
    8 2004 0         43.0506633
    7 2004 0         69.5592888
    7 2009 0        425.4202564
    7 2009 0         48.8316938
    3 2014 0 338.99444580078125
    7 2004 0        196.8181872
    5 2014 0    171.74365234375
    4 2014 0  81.94265747070313
    5 2004 0          55.624192
    7 2014 0  167.8150177001953
    7 2004 0        216.7822695
    4 2004 0         39.6975939
    4 2004 0        140.7045348
    5 2014 0 102.81233215332031
    7 2009 0         48.8575499
    7 2004 0         61.6160502
    2 2014 0  86.40637969970703
    7 2004 0        252.0847639
    5 2014 0 39.830528259277344
    5 2014 0 212.99688720703125
    7 2004 0         63.0005122
    4 2009 0        280.3971576
    4 2004 0        316.8733623
    7 2014 0  81.65100860595703
    7 2009 0          58.896558
    2 2014 0  106.8847885131836
    7 2004 0         76.3631096
    7 2014 0  79.28169250488281
    3 2009 0          41.757916
    6 2014 0  85.59104919433594
    3 2004 0        153.6330748
    7 2009 0         36.6905704
    3 2014 0 252.22463989257813
    4 2009 0        417.4908032
    7 2009 0        322.8906441
    4 2014 0 238.12564086914063
    4 2014 0  195.6365203857422
    3 2004 0        233.3426186
    9 2004 0         50.0748967
    7 2009 0        282.8731939
    7 2004 0         23.7804153
    7 2014 0  99.01948547363281
    5 2014 0 103.54468536376953
    7 2014 0  39.07099151611328
    2 2004 0         39.9511412
    8 2004 0         66.2723644
    3 2009 0         48.5983427
    4 2009 0         65.4758559
    7 2004 0         36.9676825
    8 2004 0           29.71229
    7 2014 0   80.5294418334961
    5 2014 0 44.012725830078125
    7 2014 0   85.4103012084961
    7 2004 0         54.8573573
    7 2009 0         62.7874827
    2 2009 0         53.2500612
    7 2004 0         70.8606169
    4 2004 0         46.2237267
    7 2014 0 113.39791870117188
    8 2004 0         84.5413853
    7 2014 0   70.9384536743164
    4 2004 0         76.7675104
    7 2009 0         31.1291948
    8 2004 0        149.2765038
    3 2014 0  92.45094299316406
    7 2009 0         77.3619389
    5 2009 0         91.8365641
    8 2014 0  44.35706329345703
    7 2004 0         80.3311606
    5 2014 0  95.32103729248047
    4 2009 0        207.9895668
    1 2004 0         33.1513143
    7 2014 0  95.67701721191406
    5 2004 0        155.4920705
    6 2004 0         48.5864384
    7 2014 0  81.53656768798828
    end
    label values tef1 TEF1D
    label def TEF1D 1 "1.F�hrungskr�fte", modify
    label def TEF1D 2 "2.Akademische Berufe", modify
    label def TEF1D 3 "3.Techniker und gleichrangige Berufe", modify
    label def TEF1D 4 "4.B�rokr�fte und verwandte Berufe", modify
    label def TEF1D 5 "5.Dienstleistungsberufe und Verk�ufer", modify
    label def TEF1D 6 "6.Fachkr�fte in Land- und Forstwirtschaft", modify
    label def TEF1D 7 "7.Handwerks- und verwandte Berufe", modify
    label def TEF1D 8 "8.Anlagen und Maschinenbediener, Montierer", modify
    label def TEF1D 9 "9.Hilfsarbeitskr�fte", modify
    label values is051 is051l
    label def is051l 0 "native", modify
    label values ixpxh IXPXHJD
    Would appreciate some hints, thanks!

    Comment


    • #3
      First let's clear up some terminology. "Descriptive statistics" means you are describing your study sample. If you are actually looking to do descriptive statistics, then you would not consider weighting anything. The sample is what it is.

      If, however, you are trying to draw conclusions about the population, not just describing your sample, then, you are not doing descriptive statistics, you are doing inferential statistics. And, if you know that your sample under-represents some population segments and over-represents others, then, yes, you would definitely want to weight the analysis to adjust for the imbalances in the sampling.

      To do the weighting, you need information about the discrepancy between sampling and population for the relevant subgroups at each time. This could come in the form of sampling probabilities that arise from the design of the sampling. In that case, you would weight each observation by the reciprocal of its probability of having been included in the sample. (So, if you sampled 1 out of every 100 immigrants and 1 out of every 500 natives, each immigrant's observation would receive a pweight of 100 and each native's observation would get a pweight of 500.) Or, if you don't have that kind of information about the sampling scheme but you know what the distribution of natives and immigrants in the population should be, you can use that to create post-stratification weights and apply those using the -svy- commands. You would need to read the PDF documentation that came with your Stata installation, specifically the poststratification chapter of the [SVY] manual for specific guidance how to do this.

      I think you need to figure out what that ixpxhj variable, which you refer to as an "extrapolation weight" actually is so that you can best figure out how to use it. You also definitely need to find out why it is missing so often (actually, always missing in the example you show) and how you can find the actual values.

      Comment


      • #4
        Thank you, sir! The first post should be ignored since I did something wrong. Now, in the second post, there are all correct information about the data, also new dataex. The weighting variable is ixpxh, which has now values in it.

        Comment


        • #5
          Well, you really need to check the documentation that came with your data to be sure, but my best guess is that ixpxh is a sampling design weight (inverse probability of sampling) that would be used as a pweight in Stata. The use of that weighting will allow you to get unbiased estimates of the proportions of natives and immigrants in the different occupations in each year. But do read the documentation thoroughly: there may also be stratification and various levels of sampling units. Those must also be taken into account if you need accurate standard errors, confidence intervals, or p-values.

          Anyway, the syntax for using this looks like this:

          [/code]
          svyset [pweight = ixpxh]

          svy: proportion is051, over(tef1)
          [/code]

          Note: This doesn't run well with your new example data because in that data you have all natives and no immigrants, so that standard errors cannot be calculated. Presumably in your real data you have both, and this command should get you what you want.

          Again, I can't overemphasize the importance of reading and understanding the documentation that came with your data to be sure that these really are sampling weights, and also to identify any other aspects of the sampling design that need to be accounted for in the analysis.

          Comment


          • #6
            Thank you Sir! I just checked the documentation and you were right about the sampling weights. A further question, how can I include additionally the variable year? So I can see the immigrants share in each occupation for each year? I tried to take your code and add by(year):

            Code:
            svyset [pweight = ixpxh]
            
            svy: proportion is051, over(tef1) by(year)
            However, Stata tells me that option by() is not allowed.
            Last edited by Anshul Anand; 04 Oct 2018, 10:41.

            Comment


            • #7
              Just change -over(tef1)- to -over(tef1 year)-.

              Comment


              • #8
                Thank you, Sir! Your inputs helped me a lot!

                Comment


                • #9
                  I am sorry for asking again... I would like to see how big the population size total, for immigrant and for native is for the above table for each year since this should be mentioned at the end of a table with statistics. I could get the observations for immigrants with this code and then use a calculator :
                  Code:
                  svy: total is051 if is051==1, over(tef1 year)
                  (running total on estimation sample)
                  
                  Survey: Total estimation
                  
                  Number of strata =       1        Number of obs   =     10,289
                  Number of PSUs   =  10,289        Population size = 781,050.18
                  Design df       =     10,288
                  
                  Over: tef1 year
                  _subpop_1: 1.F�hrungskr�fte 2004
                  _subpop_2: 1.F�hrungskr�fte 2009
                  _subpop_3: 1.F�hrungskr�fte 2014
                  _subpop_4: 2.Akademische Berufe 2004
                  _subpop_5: 2.Akademische Berufe 2009
                  _subpop_6: 2.Akademische Berufe 2014
                  _subpop_7: 3.Techniker und gleichrangige Be
                  _subpop_8: 3.Techniker und gleichrangige Be
                  _subpop_9: 3.Techniker und gleichrangige Be
                  _subpop_10: 4.B�rokr�fte und verwandte Beruf
                  _subpop_11: 4.B�rokr�fte und verwandte Beruf
                  _subpop_12: 4.B�rokr�fte und verwandte Beruf
                  _subpop_13: 5.Dienstleistungsberufe und Verk
                  _subpop_14: 5.Dienstleistungsberufe und Verk
                  _subpop_15: 5.Dienstleistungsberufe und Verk
                  _subpop_16: 6.Fachkr�fte in Land- und Forstw
                  _subpop_17: 6.Fachkr�fte in Land- und Forstw
                  _subpop_18: 6.Fachkr�fte in Land- und Forstw
                  _subpop_19: 7.Handwerks- und verwandte Beruf
                  _subpop_20: 7.Handwerks- und verwandte Beruf
                  _subpop_21: 7.Handwerks- und verwandte Beruf
                  _subpop_22: 8.Anlagen und Maschinenbediener,
                  _subpop_23: 8.Anlagen und Maschinenbediener,
                  _subpop_24: 8.Anlagen und Maschinenbediener,
                  _subpop_25: 9.Hilfsarbeitskr�fte 2004
                  _subpop_26: 9.Hilfsarbeitskr�fte 2009
                  _subpop_27: 9.Hilfsarbeitskr�fte 2014
                  
                  
                  Linearized
                  Over       Total   Std. Err.     [95% Conf. Interval]
                  
                  is051        
                  _subpop_1    17190.76   1107.349      15020.14    19361.38
                  _subpop_2    30077.99   1528.565      27081.71    33074.27
                  _subpop_3    38800.09   2190.378      34506.52    43093.66
                  _subpop_4    33951.25   1498.749      31013.41    36889.08
                  _subpop_5    55147.67    2189.97       50854.9    59440.43
                  _subpop_6    74193.97   3354.298      67618.89    80769.05
                  _subpop_7    22139.48   1249.769      19689.69    24589.27
                  _subpop_8    30953.02   1609.779      27797.54     34108.5
                  _subpop_9    37757.45   2362.198      33127.08    42387.82
                  _subpop_10    11256.27   914.5721      9463.532    13049.01
                  _subpop_11    10047.73   951.2557      8183.083    11912.38
                  _subpop_12    10193.63   1110.478      8016.875    12370.38
                  _subpop_13    27238.27   1594.196      24113.33     30363.2
                  _subpop_14    25433.35   1514.704      22464.24    28402.47
                  _subpop_15    37481.21   2556.275      32470.42    42492.01
                  _subpop_16    3153.234    552.409      2070.405    4236.063
                  _subpop_17     3503.41   598.4544      2330.323    4676.497
                  _subpop_18    5172.619   901.3706      3405.758    6939.481
                  _subpop_19    62213.13   2084.554         58127    66299.26
                  _subpop_20     60852.7   2258.496      56425.61    65279.79
                  _subpop_21    63119.67   3157.708      56929.95    69309.39
                  _subpop_22    27596.48   1440.851      24772.13    30420.83
                  _subpop_23    28948.96   1615.777      25781.73     32116.2
                  _subpop_24    27761.77   1982.054      23876.55    31646.98
                  _subpop_25    11670.21   901.1542       9903.77    13436.64
                  _subpop_26    12594.22   1074.153      10488.67    14699.77
                  _subpop_27    12601.65   1356.212      9943.209    15260.09
                  However, If I want this for natives also, this doesn't work:
                  Code:
                  svy: total is051 if is051==0, over(tef1 year)
                  (running total on estimation sample)
                  
                  Survey: Total estimation
                  
                  Number of strata =       1        Number of obs   =    19,060
                  Number of PSUs   =  19,060        Population size =    2,847,992
                  Design df       =    19,059
                  
                  Over: tef1 year
                  _subpop_1: 1.F�hrungskr�fte 2004
                  _subpop_2: 1.F�hrungskr�fte 2009
                  _subpop_3: 1.F�hrungskr�fte 2014
                  _subpop_4: 2.Akademische Berufe 2004
                  _subpop_5: 2.Akademische Berufe 2009
                  _subpop_6: 2.Akademische Berufe 2014
                  _subpop_7: 3.Techniker und gleichrangige Be
                  _subpop_8: 3.Techniker und gleichrangige Be
                  _subpop_9: 3.Techniker und gleichrangige Be
                  _subpop_10: 4.B�rokr�fte und verwandte Beruf
                  _subpop_11: 4.B�rokr�fte und verwandte Beruf
                  _subpop_12: 4.B�rokr�fte und verwandte Beruf
                  _subpop_13: 5.Dienstleistungsberufe und Verk
                  _subpop_14: 5.Dienstleistungsberufe und Verk
                  _subpop_15: 5.Dienstleistungsberufe und Verk
                  _subpop_16: 6.Fachkr�fte in Land- und Forstw
                  _subpop_17: 6.Fachkr�fte in Land- und Forstw
                  _subpop_18: 6.Fachkr�fte in Land- und Forstw
                  _subpop_19: 7.Handwerks- und verwandte Beruf
                  _subpop_20: 7.Handwerks- und verwandte Beruf
                  _subpop_21: 7.Handwerks- und verwandte Beruf
                  _subpop_22: 8.Anlagen und Maschinenbediener,
                  _subpop_23: 8.Anlagen und Maschinenbediener,
                  _subpop_24: 8.Anlagen und Maschinenbediener,
                  _subpop_25: 9.Hilfsarbeitskr�fte 2004
                  _subpop_26: 9.Hilfsarbeitskr�fte 2009
                  _subpop_27: 9.Hilfsarbeitskr�fte 2014
                  
                      
                  Linearized
                  Over       Total   Std. Err.     [95% Conf.    Interval]
                      
                  is051        
                  _subpop_1           0  (omitted)
                  _subpop_2           0  (omitted)
                  _subpop_3           0  (omitted)
                  _subpop_4           0  (omitted)
                  _subpop_5           0  (omitted)
                  _subpop_6           0  (omitted)
                  _subpop_7           0  (omitted)
                  _subpop_8           0  (omitted)
                  _subpop_9           0  (omitted)
                  _subpop_10           0  (omitted)
                  _subpop_11           0  (omitted)
                  _subpop_12           0  (omitted)
                  _subpop_13           0  (omitted)
                  _subpop_14           0  (omitted)
                  _subpop_15           0  (omitted)
                  _subpop_16           0  (omitted)
                  _subpop_17           0  (omitted)
                  _subpop_18           0  (omitted)
                  _subpop_19           0  (omitted)
                  _subpop_20           0  (omitted)
                  _subpop_21           0  (omitted)
                  _subpop_22           0  (omitted)
                  _subpop_23           0  (omitted)
                  _subpop_24           0  (omitted)
                  _subpop_25           0  (omitted)
                  _subpop_26           0  (omitted)
                  _subpop_27           0  (omitted)
                  I don't get it, what is wrong with this code since I am saying it should count every observation where is051==0. It gives me the observation and the population size in general, but not the frequencies in each occupation for each year when native.

                  Comment


                  • #10
                    I don't know exactly why you're getting that particular output, but even the good-looking output you show first is not correct. It is treacherous to use -if- with -svy:- commands. You should do this as:

                    Code:
                    svy: total is051, over(tef1 year is051)

                    Comment


                    • #11
                      But then I get for the natives also 0. Is that because is051 is coded as is051==1 immigrant and is051==0 as native?
                      Code:
                      svy: total is051, over(tef1 year is051)
                      (running total on estimation sample)
                      
                      Survey: Total estimation
                      
                      Number of strata =       1        Number of obs   =    29,349
                      Number of PSUs   =  29,349        Population size =    3,629,042
                      Design df       =    29,348
                      
                      Over: tef1 year is051
                      _subpop_1: 1.F�hrungskr�fte 2004 native
                      _subpop_2: 1.F�hrungskr�fte 2004 foreign
                      _subpop_3: 1.F�hrungskr�fte 2009 native
                      _subpop_4: 1.F�hrungskr�fte 2009 foreign
                      _subpop_5: 1.F�hrungskr�fte 2014 native
                      _subpop_6: 1.F�hrungskr�fte 2014 foreign
                      _subpop_7: 2.Akademische Berufe 2004 native
                      _subpop_8: 2.Akademische Berufe 2004 foreig
                      _subpop_9: 2.Akademische Berufe 2009 native
                      _subpop_10: 2.Akademische Berufe 2009 foreig
                      _subpop_11: 2.Akademische Berufe 2014 native
                      _subpop_12: 2.Akademische Berufe 2014 foreig
                      _subpop_13: 3.Techniker und gleichrangige Be
                      _subpop_14: 3.Techniker und gleichrangige Be
                      _subpop_15: 3.Techniker und gleichrangige Be
                      _subpop_16: 3.Techniker und gleichrangige Be
                      _subpop_17: 3.Techniker und gleichrangige Be
                      _subpop_18: 3.Techniker und gleichrangige Be
                      _subpop_19: 4.B�rokr�fte und verwandte Beruf
                      _subpop_20: 4.B�rokr�fte und verwandte Beruf
                      _subpop_21: 4.B�rokr�fte und verwandte Beruf
                      _subpop_22: 4.B�rokr�fte und verwandte Beruf
                      _subpop_23: 4.B�rokr�fte und verwandte Beruf
                      _subpop_24: 4.B�rokr�fte und verwandte Beruf
                      _subpop_25: 5.Dienstleistungsberufe und Verk
                      _subpop_26: 5.Dienstleistungsberufe und Verk
                      _subpop_27: 5.Dienstleistungsberufe und Verk
                      _subpop_28: 5.Dienstleistungsberufe und Verk
                      _subpop_29: 5.Dienstleistungsberufe und Verk
                      _subpop_30: 5.Dienstleistungsberufe und Verk
                      _subpop_31: 6.Fachkr�fte in Land- und Forstw
                      _subpop_32: 6.Fachkr�fte in Land- und Forstw
                      _subpop_33: 6.Fachkr�fte in Land- und Forstw
                      _subpop_34: 6.Fachkr�fte in Land- und Forstw
                      _subpop_35: 6.Fachkr�fte in Land- und Forstw
                      _subpop_36: 6.Fachkr�fte in Land- und Forstw
                      _subpop_37: 7.Handwerks- und verwandte Beruf
                      _subpop_38: 7.Handwerks- und verwandte Beruf
                      _subpop_39: 7.Handwerks- und verwandte Beruf
                      _subpop_40: 7.Handwerks- und verwandte Beruf
                      _subpop_41: 7.Handwerks- und verwandte Beruf
                      _subpop_42: 7.Handwerks- und verwandte Beruf
                      _subpop_43: 8.Anlagen und Maschinenbediener,
                      _subpop_44: 8.Anlagen und Maschinenbediener,
                      _subpop_45: 8.Anlagen und Maschinenbediener,
                      _subpop_46: 8.Anlagen und Maschinenbediener,
                      _subpop_47: 8.Anlagen und Maschinenbediener,
                      _subpop_48: 8.Anlagen und Maschinenbediener,
                      _subpop_49: 9.Hilfsarbeitskr�fte 2004 native
                      _subpop_50: 9.Hilfsarbeitskr�fte 2004 foreig
                      _subpop_51: 9.Hilfsarbeitskr�fte 2009 native
                      _subpop_52: 9.Hilfsarbeitskr�fte 2009 foreig
                      _subpop_53: 9.Hilfsarbeitskr�fte 2014 native
                      _subpop_54: 9.Hilfsarbeitskr�fte 2014 foreig
                      
                          
                      Linearized
                      Over       Total   Std. Err.     [95% Conf.    Interval]
                          
                      is051        
                      _subpop_1           0  (omitted)
                      _subpop_2    17190.76   1115.705      15003.93    19377.59
                      _subpop_3           0  (omitted)
                      _subpop_4    30077.99   1547.083      27045.64    33110.34
                      _subpop_5           0  (omitted)
                      _subpop_6    38800.09   2211.895      34464.68    43135.5
                      _subpop_7           0  (omitted)
                      _subpop_8    33951.25   1522.782      30966.53    36935.97
                      _subpop_9           0  (omitted)
                      _subpop_10    55147.67   2233.301       50770.3    59525.03
                      _subpop_11           0  (omitted)
                      _subpop_12    74193.97   3405.593      67518.85    80869.08
                      _subpop_13           0  (omitted)
                      _subpop_14    22139.48   1262.047      19665.81    24613.15
                      _subpop_15           0  (omitted)
                      _subpop_16    30953.02   1628.404      27761.28    34144.77
                      _subpop_17           0  (omitted)
                      _subpop_18    37757.45   2381.095       33090.4    42424.51
                      _subpop_19           0  (omitted)
                      _subpop_20    11256.27   918.9053      9455.175    13057.37
                      _subpop_21           0  (omitted)
                      _subpop_22    10047.73   954.5694      8176.731    11918.73
                      _subpop_23           0  (omitted)
                      _subpop_24    10193.63   1113.392       8011.33    12375.93
                      _subpop_25           0  (omitted)
                      _subpop_26    27238.27   1608.767      24085.01    30391.52
                      _subpop_27           0  (omitted)
                      _subpop_28    25433.35   1528.075      22438.26    28428.45
                      _subpop_29           0  (omitted)
                      _subpop_30    37481.21    2573.48      32437.08    42525.35
                      _subpop_31           0  (omitted)
                      _subpop_32    3153.234   552.9593      2069.409    4237.059
                      _subpop_33           0  (omitted)
                      _subpop_34     3503.41   599.0824      2329.182    4677.639
                      _subpop_35           0  (omitted)
                      _subpop_36    5172.619   902.2786      3404.113    6941.126
                      _subpop_37           0  (omitted)
                      _subpop_38    62213.13   2142.288      58014.15    66412.11
                      _subpop_39           0  (omitted)
                      _subpop_40     60852.7   2309.594      56325.79    65379.61
                      _subpop_41           0  (omitted)
                      _subpop_42    63119.67   3197.182      56853.05    69386.29
                      _subpop_43           0  (omitted)
                      _subpop_44    27596.48   1457.392      24739.92    30453.03
                      _subpop_45           0  (omitted)
                      _subpop_46    28948.96   1632.013      25750.14    32147.78
                      _subpop_47           0  (omitted)
                      _subpop_48    27761.77   1994.226      23852.99    31670.54
                      _subpop_49           0  (omitted)
                      _subpop_50    11670.21   905.8831      9894.636    13445.78
                      _subpop_51           0  (omitted)
                      _subpop_52    12594.22    1078.77      10479.79    14708.66
                      _subpop_53           0  (omitted)
                      _subpop_54    12601.65    1359.86      9936.262    15267.03

                      Comment


                      • #12
                        Yes, sorry. What you need to do is:

                        Code:
                        gen one = 1
                        svy: total one, over(tef1 year is051)

                        Comment


                        • #13
                          Sorry for the late response. This worked well. Many thanks, Sir!

                          Comment


                          • #14
                            Hi,

                            I have a similar situation but it is the case that my PSU's, pweights and strata are slightly different in each of the 3 waves. Please how can I adjust for the survey design per wave? The data is in a pooled cross-sectional format such that each observation was interviewed independent of the waves.

                            Thanks,
                            Ayesha.

                            Comment

                            Working...
                            X