Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: portfolio building according to breakpoints


From   "Fabian Schönenberger" <sch.f@gmx.ch>
To   statalist@hsphsun2.harvard.edu
Subject   st: portfolio building according to breakpoints
Date   Tue, 03 Jul 2012 15:52:16 +0200

Dear Statalist

I am facing the following challenge:

I have a panel data consisting of id and observations for each id from different point in times for various variables (for instance size). Additionally, there are variables which serve as breakpoints for building portfolios. These variables differ only between different point in times. The goal is the following: I need to assign a number between 1 and 10 (10 portfolios) for each id's size on every point in time. The assignment is dependent between which breakpoint variables size fits. So, for one year and for the first assignment test this would be:

by id: generate sizeportfolio=1 if size <breakpoint2 & if year=2000

The second:

by id: replace sizeportfolio=2 if sizeportfolio= . & if size<breakpoint4 &  size>breakpoint2 & if year=2000

What is the most efficient way to conduct this formula for many years (1974-2011) and many assignment test?

Any suggestions highly appreciated.

Thx, Fabian

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index