Statalist The Stata Listserver


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

Re: st: cutting panel data by date according to size


From   "Clive Nicholas" <[email protected]>
To   [email protected]
Subject   Re: st: cutting panel data by date according to size
Date   Mon, 29 May 2006 06:06:32 +0100 (BST)

Yasmine Kent wrote:

> I have a panel data set of companies, with my time
> variable "date" over many quarters, and my id variable
> "co". I would like to categorise my data according to
> size (my size variable is "TA"), into quintiles, BY
> QUARTER. I want to get a single new variable, call it
> quintile, that takes on values from 1-5 depending on
> which quintile of size the company falls into in that
> particular quarter. [...]

[...]

Assuming your -quarter- variable takes on as many values as there are
quarters in your dataset, then

. bysort quarter (ta): g quintile=group(5)

should do it.

CLIVE NICHOLAS        |t: 0(044)7903 397793
Politics              |e: [email protected]
Newcastle University  |http://www.ncl.ac.uk/geps

Whereever you go and whatever you do, just remember this. No matter how
many like you, admire you, love you or adore you, the number of people
turning up to your funeral will be largely determined by local weather
conditions.

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index