Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: how to construct change in earnings since last election


From   Robson Glasscock <[email protected]>
To   [email protected]
Subject   Re: st: how to construct change in earnings since last election
Date   Sat, 11 Feb 2012 09:19:42 -0500

Try -help xtset-. Specifically, read up on the delta option and
time-series lag operator.

best,
Robson Glasscock

On Fri, Feb 10, 2012 at 6:07 PM, hnbc1 <[email protected]> wrote:
> Hi all, my question is as follows:
> Suppose we have a panel dataset like
>
> County Earnings Votes Change_in_earnings_since_last_election
> 1 10 3 .
> 1 20 . .
> 1 30 . .
> 1 40 4 1
> 2 20 . .
> 2 30 4 .
> 2 40 . .
> 2 50 3 -1
> 3 30 1 .
> 3 40 2 1
> 3 50 . .
> 3 60 4 2
>
> The time dimension is year. We don't have votes every year because
> counties don't have elections every year.
> The variable I want to construct is
> Change_in_earnings_since_last_election. As is shown in the table, only
> the last observation of county 1, 2, 3, and the second observation of
> county 3 have nonmissing data for this variable. How can I do this
> systematically? Thank you very much.
>
> Paul
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index