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" <>
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:
Newcastle University  |

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

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index