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: Plotting several linear associations in one graph for comparison


From   Amal Khanolkar <Amal.Khanolkar@ki.se>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: Plotting several linear associations in one graph for comparison
Date   Fri, 13 Jul 2012 12:42:19 +0000

Hi all,

- I've run some very basic and simple linear regression models to analyse associations between standardized birth weight and blood pressure, adjusting for confounders like birth year, current age, BMI, height etc. 

- The associations between birth weight and blood pressure are stratified by ethnicity (12 ethnic goups - thus 12 separate linear regression models). I see that the association between birth weight and blood pressure does differ in the various ethnic goups.

- I would now like to plot the above associations in a single graph using different colours for the various ethnic groups for comparison.

Any ideas how this can be done appropriately?  

I have previously used the kdensity and twoway commands to plot BW distributions by ethnic groups as follows:

kdensity bw if motherland==1 , generate(x_sweden y_sweden)
kdensity bw if motherland==5 , generate(x_poland y_poland)
kdensity bw if motherland==7 , generate(x_arab y_arab)
kdensity bw if motherland==8 , generate(x_iraq y_iraq)

twoway (line y_sweden x_sweden, sort) ///
       (line y_poland x_poland, sort) ///
       (line y_arab x_arab, sort) ///
	   (line y_iraq x_iraq, sort) ///

legend(order(1 "Sweden" 5 "Poland" 7 "Arab" 8 "Iraq")) 


Can the above twoway command be manipulated for my current need? Or any other suggestions? 

Thanks & regards,


Amal Khanolkar.


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