Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: scatter line and reshape question


From   Arina Viseth <[email protected]>
To   [email protected]
Subject   Re: st: scatter line and reshape question
Date   Mon, 19 Oct 2009 10:41:01 -0400 (EDT)

Dear Marteen,

Sorry to be back. About for my first question - I wanted the country names to shopw up, so I got rid of the commas as you suggested,  and it works great. However, I tried the same command by(country_name) using a computer's friend and without alterations to the country name commas, and the command works fine. Both computers have stata 10: so I am wondering, maybe I need to do some updates, but I am not sure if this is the issue here. Could you please help again?

thank you
Arina
---- Original message ----
>Date: Mon, 19 Oct 2009 07:07:53 +0000 (GMT)
>From: [email protected] (on behalf of Maarten buis <[email protected]>)
>Subject: Re: st: scatter line and reshape question  
>To: [email protected]
>
>--- 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/
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index