Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 65094

Problem on using foreach

$
0
0
Dear all,

I would like to use foreach for generating new variables for each disease, however, I do not figure it out how to do that. Could you help me, please.

Code:
.        .         gen viemdaday=(benh=="viem da day") if !missing(benh)

.         svy: proportion viemdaday
(running proportion on estimation sample)

Survey: Proportion estimation

Number of strata =       1         Number of obs    =     3594
Number of PSUs   =      32         Population size  =  1827786
                                   Design df        =       31

--------------------------------------------------------------
             |             Linearized
             | Proportion   Std. Err.     [95% Conf. Interval]
-------------+------------------------------------------------
viemdaday    |
           0 |   .8812902    .010411       .858361    .9009359
           1 |   .1187098    .010411      .0990641     .141639
--------------------------------------------------------------

.         
.         gen tanghuyetap=(benh=="tang huyet ap") if !missing(benh)

.         svy: proportion tanghuyetap
(running proportion on estimation sample)

Survey: Proportion estimation

Number of strata =       1         Number of obs    =     3594
Number of PSUs   =      32         Population size  =  1827786
                                   Design df        =       31

--------------------------------------------------------------
             |             Linearized
             | Proportion   Std. Err.     [95% Conf. Interval]
-------------+------------------------------------------------
tanghuyetap  |
           0 |   .9198744   .0099142      .8971826    .9379047
           1 |   .0801256   .0099142      .0620953    .1028174
--------------------------------------------------------------

Thank you so much in advance!

Viewing all articles
Browse latest Browse all 65094

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>