Re: Calculating percent change using panel data set

Posted by Art Kendall on
URL: http://spssx-discussion.165.s1.nabble.com/Calculating-percent-change-using-panel-data-set-tp5713457p5713462.html

open a new instance of SPSS. paste the syntax below int a syntax window. Run it.
is this what you are looking for?
data list list /hospital (f1) year(f4) unemployed (f4).
begin data.
1 2008 1000
1 2009 1010
1 2010 1020
1 2011 1031
2 2008 1000
2 2009  990
2 2010  980
2 2011  970
3 2008 1000
3 2010 1020
3 2011 1031
4 2008 1000
4 2009 1010
4 2010 1020
4 2011 1031
5 2008  500
5 2009  525
5 2010  552
5 2011  580
6 2008 100
6 2009  90
6 2010 110
6 2011 125
end data.
numeric demo1yrago since1yrago since2yrago since3yrago(pct7.1).
if lag(hospital,1) eq hospital demo1yrago = 100* ( ( (unemployed/lag(unemployed,1) ) -1) ).
do repeat periods = 1 to 3/ since= since1yrago to since3yrago.
do if hospital eq  lag(hospital,periods)  and year eq lag(year,periods)+periods.
compute  since = 100* ( ( ( (unemployed/lag(unemployed,periods) ) **(1/periods) ) )-1).
end if.
end repeat.
list.



Art Kendall
Social Research Consultants

On 5/31/2012 11:21 PM, Virginia Razo wrote:
I have a panel data set and I need to compute the percent change in a
continuous variable for a 4 year period.  How can I compute this in SPSS?

My data looks like this

Hospital 1          2008        unemployment rate
Hospital 1          2009        unemployment rate
Hospital 1          2010        unemployment rate
hospital 1          2011        unemployment rate
hospital 2          2008        ""
hospital 2          2009         ""
etc.

Can anyone assist me with this type of calculation using a panel data set?

Thanks,
Ginny Razo


--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Calculating-percent-change-using-panel-data-set-tp5713457.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Art Kendall
Social Research Consultants