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

Re: st: Panel data manipulation

From   Maarten buis <>
Subject   Re: st: Panel data manipulation
Date   Tue, 25 Nov 2008 14:46:21 +0000 (GMT)

--- "s.afcha" <> wrote:
> I'm working with a panel data and I have a little question. 
> I have observations for firms' R&D expenditures for 8 years. 
> I would  like to keep observations for all that  firms that performs
> or has performed R&D during at least one year (R&D expenditures>0 for
> at least one year).

assuming the firms are identified by a variable called firmid and R&D
expenditure by a variable called rdexp:

bys firmid: egen totrdexp = total(rdexp)
gen byte nord = totrdexp == 0 

This creates a dummy which has value 1 when the firm never did any R&D
expenditure (or if that firm has only missing values on the variable
rdexp) and 0 when it did at least during one year some R&D expenditure.
Later you can either drop if nord == 1 or do your analysis with the
addition of -if nord == 0-

Hope this helps,

Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room N515

+31 20 5986715

*   For searches and help try:

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