Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: get summary files from svytab


From   "Markus Steiner" <markus.steiner@ed.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: get summary files from svytab
Date   Mon, 8 Nov 2004 14:24:41 -0000

Hello all,

I am quite new to Stata but experienced to SAS, and I have tried several
faq and the online help. The problem I am struggling in Stata now is how
to get the output from procedures like svytab into a file for further
usage.
What I am trying here is to get the counts (plus percentages at the same
time if possible) from svytab for further usage.

svytab dmethn sex if age >= 16, count format(%9.1f)

pweight:  scalewt               Number of obs      =     13947
Strata:   samp                  Number of strata   =         8
PSU:      area                  Number of PSUs     =       716
                                Population size    = 101246.44

-------------------------------------
derived   |            sex           
ethnicity |     men    women    Total
----------+--------------------------
 caribbea |   367.2    503.1    870.2
   indian |   595.4    616.2   1211.7
 pakistan |   357.8    369.8    727.6
 banglade |   136.6    138.7    275.4
  chinese |    95.5    112.9    208.4
    irish |  1546.3   1988.2   3534.5
   core99 | 42975.6  51443.1  94418.7
          | 
    Total | 46074.4  55172.0  101246.4
-------------------------------------
  Key:  weighted counts

The problem here I can not use collate because of the weighting - using
[pweight=] I will get quite similar but not the same results as with
svytab.

I have tried parmby, but still does not get what I want, it saves the
percentages (with parameter names you have to guess what it was) but not
the count. That is what I get:

       parmseq   parm    estimate  
  1.         1    p11   .00362659  
  2.         2    p12   .00496864  
  3.         3    p21   .00588117  
  4.         4    p22   .00608655  
  5.         5    p31   .00353386  
  6.         6    p32    .0036525  
  7.         7    p41   .00134933  
  8.         8    p42    .0013703  
  9.         9    p51   .00094364  
 10.        10    p52   .00111474  
 11.        11    p61   .01527235  
 12.        12    p62   .01963738  
 13.        13    p71   .42446516  
 14.        14    p72   .50809779  

To calculate the count you would need the population size from the
screen output, but it is not saved in this file. Then you could easily
calculate the count (and I would be happy...).

Are there any other ways I have not come across yet, which would do the
trick? In SAS it was quite easy to save your results, either with the
/out or /output option, depending on the procedure.

Any help is regarded,
thank you,
Markus

/**********************************
Markus Steiner, MSc
Clinical Research Fellow
Public Health Sciences
The Medical School, Teviot Place
Edinburgh EH8 9AG
Tel: +44-(0)131-650 3204
EMail: markus.steiner@ed.ac.uk
**********************************/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index