Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: how to best 2 graphs


From   Lucie Vlach <Lucie.Vlach@albertahealthservices.ca>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: how to best 2 graphs
Date   Mon, 19 Dec 2011 15:52:34 -0700

Hello all!

I need to graph 2 variables together: CRG variable and AGE variable. I need to combine the graphs with shared X axis to be AGE (grouped by 5 yr spans) and the Y axis would be frequency.
The graphs should be combined vertically, the "crg" variable on top (showing mean line per corresponding age groups) and age histogram on the bottom. I tried a variety of twoway commands, but it all looks bad.

Any help is very much appreciated!
Thank you!

Lucie


1) Var: "crg" (long %12.0g]
looks like:
10000
51832
10010
51832
51832
54421
37552
57471
10000
54241
54241
54241
10000
20200
40002

Possible 3 different age variables that could be used.
I have these:

2) Var: patient_age_at_visitR (float %9.0g)
34.29706
61.32238
22.02327
66.04791
68.70089
55.62218
32.07666
21.2512
31.5154
2.466804
46.84463

OR

3) Variables such as
age51_55 (float %9.0g)
age56_60
age61_65
age66_70
each indicating 0 or 1
etc...

OR

4) Var: patient_age_by10yr (float %9.0g) recoded as:
40-49
1-9
80-89
20-29
50-59
50-59
etc...
Data such as:
    <1 |  70
   1-9 | 163
 10-19 | 161
 20-29 | 323
etc...
I can change this to 5 yr span, if this variable would be used.

This message and any attached documents are only for the use of the intended recipient(s), are confidential and may contain privileged information. Any unauthorized review, use, retransmission, or other disclosure is strictly prohibited. If you have received this message in error, please notify the sender immediately, and then delete the original message. Thank you.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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   |   Site index