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

st: Graph from 'dstdize'-output


From   "Peter Jepsen" <pjspam@nisjepsen.dk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Graph from 'dstdize'-output
Date   Sat, 30 Oct 2004 12:57:11 +0200

Dear Statalisters,

I have standardized crude incidence rates using 'dstdize', as described in
the manual. A snippet of the output is here: 

Summary of Study Populations:
     year
     male             N      Crude     Adj_Rate       Confidence Interval
 --------------------------------------------------------------------------
     1977
        0       2567052  9.739e-06    9.748e-06    [ 5.875e-06,   1.362e-05]
     1977
        1       2512827  6.367e-06    7.836e-06    [ 3.599e-06,   1.207e-05]
     1978
        0       2577115  6.208e-06    6.227e-06    [ 3.137e-06,   9.318e-06]
     1978
        1       2519844  3.968e-06    5.532e-06    [ 2.006e-06,   9.058e-06]
     1979
        0       2585949  4.254e-06    3.961e-06    [ 1.600e-06,   6.322e-06]
     1979
        1       2525588  4.355e-06    5.122e-06    [ 2.039e-06,   8.205e-06]
.
.
. (continues to 2002)

I would like to graph the gender-specific standardized incidence rates by
year, but I find it very difficult to do because the adjusted rates are
stored in a matrix, whereas the years and genders are not. I have no
experience with matrices, but I managed to make the data useable through...

	matrix peter=r(se) \ r(ub) \ r(lb) \ r(adj) \ r(crude) \ r(Nobs)
	matrix peter=peter'
	svmat double peter, name(col)

However, I had to add the years and genders to the correct rates using ...

	egen male=fill(0 1 0 1)
	egen year=fill(1977 1977 1978 1979)	

And that made it possible to graph all the things I wanted. But isn't there
a better way to do this? I would love it if the 'Summary of Study
populations' were stored in a dataset. I can't make sense of the
'dstdize.ado'-file.

Thank you for any insights.

Peter Jepsen.

*
*   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