Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: Re: Panel data manipulation question


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: Re: Panel data manipulation question
Date   Tue, 16 Jul 2002 17:37:46 +0100

Nick
[email protected]

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]On Behalf Of
> Brooks Taggert
> J
> Sent: 16 July 2002 15:27
> To: [email protected]
> Subject: st: RE: Re: Panel data manipulation question
>
>
> Scott and Nick Cox-
>
>
> This is indeed a neat little solution, but It won't work for me as I
> have an unbalanced panel...I have a different number of
> years for each
> country.  However now that I think about it the main data
> I'll need for
> this paper is consistent across countries so I could
> balance it, then
> run your suggestion.
>
> Thanks much.
> TJ
>
> -----Original Message-----
> From: Scott Merryman [mailto:[email protected]]
> Sent: Monday, July 15, 2002 6:15 PM
> To: [email protected]
> Subject: st: Re: Panel data manipulation question
>
> I think something like this should work.  Using data available from
> Stata
> Press website:
>
> use http://www.stata-press.com/data/r7/grunfeld.dta, clear
> gen m10 = mv if company == 10
> for num 180(-20)20 : replace m10 = m10[_n +X ] if  m10== .
> gen X = mv / m10
>
> This will create variable X, the market value (mv) of each
> firm divided
> by
> the market value of firm 10.
>
> Scott Merryman
>
>
> ----- Original Message -----
> From: "Brooks Taggert J" <[email protected]>
> To: <[email protected]>
> Sent: Monday, July 15, 2002 2:07 PM
> Subject: st: Panel data manipulation question
>
>
> > Statlisters-
> >
> > I can't seem to figure out how to do this easily,
> although I'm quite
> sure
> it must be possible.  I have a panel data set on individual
> countries
> and I
> want to create a new variable.  The variable is going to be
> the ratio of
> a
> variable I already have in my dataset, we'll call it P.  I want to
> create a
> variable we'll call X where x=p/p(i==72).  That is to say I want to
> deflate
> all the values of p, by the value of p for country 72, for the
> corresponding
> year.  I thought about trying to grab the time series for
> that specific
> country and appending it to every other country, but that
> seems awkward.
> I've thought about reshaping the data, but that seems
> tedious as well.
> Any
> suggestions are always appreciated.
> >
> >
> > Thanks.
> >
> > TJ
> >
>
>
>
> *
> *   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/
> *
> *   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/

*
*   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