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
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: Thread-Index: Ac049lzDw8LzBnUBQd+6mSCfgPrdJg==
Date
Thu, 24 May 2012 15:18:20 +0100
Your syntax like
`: lab Sweden'
is illegal as a way of looking up value labels and not analogous to
Austin's example. See -help extended fcn-.
There are two main syntaxes
`: valuelabelname #'
`: (varname) #'
and yours is neither.
You could just say (e.g.)
title(Sweden)
if that is what you want.
For the rest, try the sections in [U] on local macros and weights.
Nick
On Thu, May 24, 2012 at 3:07 PM, Amal Khanolkar <[email protected]> wrote:
> 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.
*
* 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/