While doing analysis recently, I came across a peculiar problem. For reproducibility, the two .dta files are attached.

The Standard Population data in "oneDistpop.dta" is
Code:
list, clean noobs abbreviate(20)
    areacode2      sex   ageGrp      ageSexGrp   dist50_byagesex       p  
        Jammu     Male    50-59     Male 50-59             70193   70193  
        Jammu     Male    60-69     Male 60-69             41400   41400  
        Jammu     Male    70-79     Male 70-79             21287   21287  
        Jammu     Male     >=80      Male >=80             10085   10085  
        Jammu   Female    50-59   Female 50-59             61583   61583  
        Jammu   Female    60-69   Female 60-69             38746   38746  
        Jammu   Female    70-79   Female 70-79             21172   21172  
        Jammu   Female     >=80    Female >=80             11119   11119
The study data in "oneDistData.dta" is individual level data:
Code:
list in 1/10, clean noobs abbreviate(20)

    areacode2   cluster        id      sex   ageGrp      ageSexGrp   dist50_byagesex   p   outcome  
        Jammu         1   1100101   Female    50-59   Female 50-59             61583   1         0  
        Jammu         1   1100102   Female    60-69   Female 60-69             38746   1         0  
        Jammu         1   1100103     Male    70-79     Male 70-79             21287   1         1  
        Jammu         1   1100104   Female    50-59   Female 50-59             61583   1         0  
        Jammu         1   1100105   Female    50-59   Female 50-59             61583   1         0  
        Jammu         1   1100106   Female    60-69   Female 60-69             38746   1         0  
        Jammu         1   1100118     Male    60-69     Male 60-69             41400   1         1  
        Jammu         1   1100119     Male    60-69     Male 60-69             41400   1         0  
        Jammu         1   1100120   Female    60-69   Female 60-69             38746   1         0  
        Jammu         1   1100122   Female    50-59   Female 50-59             61583   1         0
I am interested in direct standardised Prevalence of outcome. The Sample's age-sex distribution to be direct standardised against the district population.


Option 1: dstdize command

Code:
dstdize outcome p  ageSexGrp , by(areacode2) using("oneDistPop.dta")  level(95) format(%10.6f)  print

... Output Ommited

-> areacode2= 1 
                         -----Unadjusted-----  Std.
                                Pop.  Stratum  Pop.  
  Stratum       Pop.     Cases  Dist. Rate[s] Dst[P]  s*P
----------------------------------------------------------
 Female 5        767        37  0.279 0.0482  0.223 0.0108
 Female 6        512        80  0.186 0.1562  0.141 0.0220
 Female 7        229        45  0.083 0.1965  0.077 0.0151
 Female >         98        28  0.036 0.2857  0.040 0.0115
 Male 50-        459        29  0.167 0.0632  0.255 0.0161
 Male 60-        368        42  0.134 0.1141  0.150 0.0171
 Male 70-        236        47  0.086 0.1992  0.077 0.0154
 Male >=8         82        18  0.030 0.2195  0.037 0.0080
----------------------------------------------------------
Totals:         2751       326    Adjusted Cases:    319.2
                                      Crude Rate:   0.1185
                                   Adjusted Rate:   0.1160
                       95% Conf. Interval: [0.1041, 0.1279]

Summary of Study Populations:
 areaco~2             N      Crude     Adj_Rate       Confidence Interval
 --------------------------------------------------------------------------
        1          2751   0.118502     0.116026    [  0.104115,    0.127938]

.
Option 2: proportion with stdize and stdweight

Code:
proportion outcome, stdize(ageSexGrp) stdweight(dist50_byagesex) 

Proportion estimation

N. of std strata =       8        Number of obs   =      2,751

--------------------------------------------------------------
             |                                   Logit
             | Proportion   Std. Err.     [95% Conf. Interval]
-------------+------------------------------------------------
outcome      |
           0 |   .8839737   .0060774      .8715152    .8953692
           1 |   .1160263   .0060774      .1046308    .1284848
--------------------------------------------------------------
I am not sure why the 95% CIs are different. The Directly Standardised Proportion in both is correct
The OPTION 2 works better for me since I can use it after svyset.
But I can see that Option 1 is working the way direct standardisation is supposed to work.

Code:
svyset cluster, vce(linearized) singleunit(certainty)
svy  : proportion outcome, stdize(ageSexGrp) stdweight(dist50_byagesex)
Its this behaviour expected ?
I am sure I am missing something here. Maybe something to do with logit based CIs perhaps when using prop with stdize.

I would be grateful if someone can help me understand the reason for differing results.

Best Wishes
Vivek