Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Twoway graph with different scaled y axes
From
Maria Ana Vitorino <[email protected]>
To
[email protected]
Subject
st: Twoway graph with different scaled y axes
Date
Tue, 19 Mar 2013 16:24:09 -0500
Dear Statalist members,
I'm trying to do 2 graphs on the same figure but am having trouble with twoway.
Here is a sample of my data:
agegroup gender cases rateper1000
15-20 F 10000 5.3
20-25 F 15000 8.3
25-30 F 12000 6.5
15-20 M 18000 9.3
20-25 M 12000 5.3
25-30 M 8000 2.5
I would like to have both figures in the same plot:
1) graph bar cases, over(gender, label(labsize(small))) asyvars over(agegroup, label(labsize(vsmall))) ytitle("Number of Cases") b1title("Age")
AND
2) a graph that has the variable rateper1000 on another axis and that shows (with dots) the rate per agegroup and age and connects those dots.
The figure at http://www.cancerresearchuk.org/cancer-info/cancerstats/incidence/age/#Cancer
depicts well what I am trying to achieve.
Any suggestions are welcome!
Thanks!
Ana
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/