Statalist The Stata Listserver


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

st: creating a special sample split (panel data)


From   "Alessandro Fiaschi" <alefiaschi@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: creating a special sample split (panel data)
Date   Fri, 3 Nov 2006 18:30:36 +0100

I have a panel of 1000 firms and I wish to generate two subsamples of
firms with relatively low and relatively high mvalue during our sample
period. The sample splits should be achieved as follows: each firm
should be assigned to a high (resp. low) category according to its
position in the first year it enters the sample relative to the median
across all firms in the first year they enter the sample. For example,
firm 1 was categorised as a high mvalue firm if its mvalue in 1948,
the first year firm XYZ entered the sample, was above the median
dividend payout ratio across all firms in the first year they entered
the sample. I would be very grateful I somebody could write me the
Stata commands useful to enter this particular sample splitting.

Here is a basic sample (just three companies).

company year    invest    mvalue   kstock  time

1	1935	317.6	3078.5	2.8	1
1	1936	391.8	4661.7	52.6	2
1	1937	410.6	5387.1	156.9	3
1	1938	257.7	2792.2	209.2	4
1	1939	330.8	4313.2	203.4	5
1	1940	461.2	4643.9	207.2	6
1	1941	512	4551.2	255.2	7
1	1942	448	3244.1	303.7	8
1	1943	499.6	4053.7	264.1	9
1	1944	547.5	4379.3	201.6	10
1	1945	561.2	4840.9	265	11
1	1946	688.1	4900.9	402.2	12
1	1947	547.5	3999	547.5	13
1	1948	321.6	5411	547.5	14
1	1949	.	.	.	15
1	1950	.	.	.	16
1	1951	.	.	.	17
1	1952	.	.	.	18
1	1953	.	.	.	19
1	1954	.	.	.	20
2	1935	.	.	.	1
2	1936	77.2	118	50.5	2
2	1937	44.6	156.2	118.1	3
2	1938	48.1	172.6	260.2	4
2	1939	74.4	186.6	312.7	5
2	1940	113	220.9	254.2	6
2	1941	91.9	118	261.4	7
2	1942	445.6	156.2	298.7	8
2	1943	48.1	172.6	48.1	9
2	1944	74.4	186.6	74.4	10
2	1945	113	220.9	113	11
2	1946	91.9	91.9	91.9	12
2	1947	.	.	.	13
2	1948	.	.	.	14
2	1949	.	.	.	15
2	1950	.	.	.	16
2	1951	.	.	.	17
2	1952	.	.	.	18
2	1953	.	.	.	19
2	1954	.	.	.	20
3	1935	61.3	61.3	61.3	1
3	1936	45	2015.8	104.4	2
3	1937	77.2	2803.3	118	3
3	1938	44.6	2039.7	156.2	4
3	1939	48.1	2256.2	172.6	5
3	1940	74.4	2132.2	186.6	6
3	1941	113	1834.1	220.9	7
3	1942	91.9	1588	287.8	8
3	1943	61.3	1749.4	319.9	9
3	1944	56.8	1687.2	321.3	10
3	1945	93.6	2007.7	319.6	11
3	1946	159.9	2208.3	346	12
3	1947	147.2	1656.7	456.4	13
3	1948	146.3	1604.4	543.4	14
3	1949	98.3	1431.8	618.3	15
3	1950	93.5	1610.5	647.4	16
3	1951	135.2	1819.4	671.3	17
3	1952	157.3	2079.7	726.1	18
3	1953	179.5	2371.6	800.3	19
3	1954	189.6	2759.9	888.9	20

....


Waiting for an help, thank you in advance to all.

Yours,

Nick

Alessandro

Alessandro Fiaschi
Dipartimento di Scienze Economiche, University of Rome "La Sapienza"
Via Cesalpino 12 - 00161 Rome (Italy)
*
*   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