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: Reshape help


From   Scott Merryman <[email protected]>
To   [email protected]
Subject   Re: st: Reshape help
Date   Fri, 21 May 2010 08:35:59 -0500

clear*
input str8 date str3 id str3 return
"1/1/2010" "XYZ" "10%"
"2/1/2010" "XYZ" "11%"
"1/1/2010" "ABC" "5%"
"2/1/2010" "ABC" "6%"
end

reshape wide return ,i(date) j(id) string
renpfix return
l

Scott

On Fri, May 21, 2010 at 8:25 AM, Joshua Shindell <[email protected]> wrote:
>
> Dear Statalist,
>
> I have stock return data in the following format:
> Date       id     return
> 1/1/2010 XYZ 10%
> 2/1/2010 XYZ 11%
> 1/1/2010 ABC 5%
> 2/1/2010 ABC 6%
>
> I would like to get the data in the following format:
> date        XYZ    ABC
> 1/1/2010  10%    5%
> 2/1/2010  11%    6%
>
>
> I am having trouble using the -reshape- command to perform this
> rearrangement.  Many thanks for any help or suggestions.
>
> Best,
>
> Joshua A. Shindell

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