Bookmark and Share

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]

RE: st: Thread-Index: Ac049lzDw8LzBnUBQd+6mSCfgPrdJg==


From   Amal Khanolkar <[email protected]>
To   "[email protected]" <[email protected]>
Subject   RE: st: Thread-Index: Ac049lzDw8LzBnUBQd+6mSCfgPrdJg==
Date   Thu, 24 May 2012 14:07:12 +0000

Dear Austin,

Based on the code you suggested, I have the following:

loc c vioplot bw [pw=finalwgt]
`c' if motherland3==1, ti(`:lab Sweden') den(col(blue)) name(e1)
`c' if motherland3==2, ti(`:lab NA') den(col(green)) name(e2) ysc(off)
`c' if motherland3==3, ti(`:lab Iran') den(col(edkblue)) name(e3) ysc(off)
gr combine Sweden NA Iran, nocop ycommon row(1) name(vio)
byhist bw, by(motherland3) frac tw(leg(col(1)))


- where bw is the continous outcome whose distributions I would like to produce by the categorical variable motherland3 which has 10 categories.

- I've just wirtten the lines for the first 3 categories of the motherland3 variable above.

-However I keep getting a error message that the line 'c' if motherland3==1....' is invalid syntax. Could you please tell me what I'm doing wrong and what exactly the 'c' signifies?

I also want to know what the (pw=finalwgt) does.

Thanks a lot!

Regards,

/Amal.

Amal Khanolkar, PhD candidate,
Centre for Health Equity Studies (CHESS),
Karolinska Institutet,
106 91 Stockholm.

Ph# +46(0)8 162584/+46(0)73 0899409
www.chess.su.se
________________________________________
From: [email protected] [[email protected]] on behalf of Austin Nichols [[email protected]]
Sent: 23 May 2012 20:25
To: [email protected]
Subject: Re: st: Thread-Index: Ac049lzDw8LzBnUBQd+6mSCfgPrdJg==

Amal Khanolkar <[email protected]>:
Try also :

ssc inst vioplot, replace
ssc inst byhist, replace
clear all
webuse nhanes2
la var race "Race"
loc c vioplot bpsystol [pw=finalwgt]
`c' if race==1, ti(`:lab race 1') den(col(blue)) name(r1)
`c' if race==2, ti(`:lab race 2') den(col(green)) name(r2) ysc(off)
`c' if race==3, ti(`:lab race 3') den(col(edkblue)) name(r3) ysc(off)
gr combine r1 r2 r3, nocop ycommon row(1) name(vio)
byhist bpsystol, by(race) frac tw(leg(col(1)))


On Wed, May 23, 2012 at 11:44 AM, Nick Cox <[email protected]> wrote:
> "plot distributions" is a bit open-ended, but
>
> -twoway kdensity-
>
> -dotplot-
>
> -distplot- (SJ)
>
> -qplot- (SJ)
>
> -stripplot- (SSC)
>
> give you some ways of approaching this. FWIW, different colours are
> not needed (or even possible) with -dotplot-.
>
> On Wed, May 23, 2012 at 4:11 PM, Amal Khanolkar <[email protected]> wrote:
>
>> I would like to know how I can plot several distributions of a continuous variable, say birth weight in different colours  by ethnic groups in the graph?
>
> *
> *   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/

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

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index