Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Incorporating variable labels into the variable name


From   "Sergiy Radyakin" <serjradyakin@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Incorporating variable labels into the variable name
Date   Thu, 13 Sep 2007 17:10:14 +0200

Why would the values for Jacky be imported correctly, but the values
for Mike are all zeroes?

Wouldn't it make more sence to store the data in the layout:

account name date value

??


Best regards, Sergiy




On 9/7/07, Rodriguez, Dan <dan.rodriguez@credit-suisse.com> wrote:
>
>
> I have a comma-delimited datafile that I need to process on a daily basis
> within Stata where I need to convert the labels for about 200 columns into
> variable names. The file looks like the following:
>
> acct    name    9/5/2007        9/4/2007        8/31/2007
> 84J     Jacky   1       2       -1
> B88     Mike    -2      3       -1
> B93     Mike    4       5       2
>
>
> When I import this file into Stata I get:
>
> acct            name    v18     v19     v20
> 84J             Jacky   1       2       -1
> B88             Mike    0       0       0
> B93             Mike    0       0       0
>
> . desc
>
> Contains data
>   obs:         1,495
>  vars:           190
>  size:     1,728,220 (83.5% of memory free)
> -------------------------------------------------------------------------------
>               storage  display     value
> variable name   type   format      label      variable label
> -------------------------------------------------------------------------------
> acct            str8   %9s                    Trading Acct
> name            str53  %53s                   Trader
> v18             float  %9.0g                  9/5/2007
> v19             float  %9.0g                  9/4/2007
> v20             float  %9.0g                  8/31/2007
> v21             float  %9.0g                  8/30/2007
> v22             float  %9.0g                  8/29/2007
> v23             float  %9.0g                  8/28/2007
> v24             float  %9.0g                  8/27/2007
> v25             float  %9.0g                  8/24/2007
> v26             float  %9.0g                  8/23/2007
> v27             float  %9.0g                  8/22/2007
> v28             float  %9.0g                  8/21/2007
> v29             float  %9.0g                  8/20/2007
>
> How can I change the variable names to rev_Sep5_2007, rev_Sep4_2007,
> rev_Aug31_2007, etc.?
>
> I need to apply a reshape command to facilitate further analysis.
>
> Thank you,
> Dan Rodriguez
>
> ==============================================================================
Please
> access the attached hyperlink for an important electronic communications
> disclaimer:
>

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================
>
>
>
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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   |   What's new   |   Site index