--- On Mon, 19/10/09, Arina Viseth wrote:
> 1) I would like to draw scatter lines (Y: value, X: time),
> for difference countries. I have inputed the country_name
> (string) and also the country_code (float).
>
> However, my scatter line by country works only when I
> type:
> twoway line value time, by(country_id)
>
> but although in the help section, it says that the by
> option may be use with numeric or string variables, I can't
> draw any scatter lines when I type:
> twoway line value time, by(country_name)
>
> And instead I have the following error message: "option
> Dem. not allowed
> r(198);"
>
> Could you please help me with what I am doing wrong here?
Sounds to me like you have a comma somewhere in those
strings. Anyhow, the simplest solution is to use the numeric
version of that variable, since you already have that in
your data.
> 2) my second question is: I would like to use the reshape
> long command, but instead of years, I would have quarterly
> data(for example q1_2005 q2_2005..etc). So I am not sure
> what to put after the "j" in reshape long command: long
> value, i(id) j(?)
-reshape- doesn't know or cares whether j is measured in
years, kilos, cows, or quarters, so using your quarter
variable is not a problem at all. I am guessing that
variable is a string, so you will also need to specify
the -string- option.
Hope this helps,
Maarten
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://www.maartenbuis.nl
--------------------------
*
* 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/