Index numbers with SPSS

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Index numbers with SPSS

Pedro Campos-2
Can you please tell me how to construct a Laspeyres or a Paasche index
with SPSS?

 

Regards

Pedro Campos

====================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
Reply | Threaded
Open this post in threaded view
|

Re: Index numbers with SPSS

Hector Maletta
It is much easier in Excel. Columns should be:
A.Name of good or service
B.Budget share at base period (initial) for Laspeyres index
C.Price at initial period
D.Price at final period

Suppose your goods are 99, from row 2 to row 100.
At column E compute for each good the formula of price change ratio =D/C.
Below the last good in column E compute=SUMPRODUCT(B2:B100,E2:E100).
The result is your Laspeyres index.
For Paasche:
In column B introduce the correct budget shares (from last period).
In column F put reverse price ratios = C/D (initial price/final price).
Below column F put =1/(sumproduct((B2:B100,F2:F100).
This is your Paasche index.
In both instances I have expressed the index as a weighted average of price
ratios, weighted by (initial or final) budget shares, rather than the usual
formula of prices by quantities. Laspeyres indexes are an arithmetic mean of
price ratios, while Paasche indexes are a harmonic mean of price ratios. The
harmonic mean is the reciprocal of the mean of reciprocals. Intermediate
between the two is the Geometric Index, which is a geometric mean, i.e. the
product of all price ratios, each to the power of Wi.
All this can also be achieved with SPSS, of course, putting goods as rows
and dates as columns or the reverse, but I find it easier with a
spreadsheet.
Saudacoes.
Hector





-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Pedro Campos
Sent: 20 November 2008 10:18
To: [hidden email]
Subject: Index numbers with SPSS

Can you please tell me how to construct a Laspeyres or a Paasche index
with SPSS?



Regards

Pedro Campos


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
Reply | Threaded
Open this post in threaded view
|

AW: Index numbers with SPSS

Mario Giesel
In reply to this post by Pedro Campos-2
Hello, Pedro,
 
is it this what you are looking for?
 
Good luck,
Mario
 
* ------------------------------------------------.
* Calculation of price indices.
* nov 2008 (mg).
* ------------------------------------------------.
 
* 1. Generate example data.
DATA LIST FIXED
/p1 1-5 q1 7-8 p2 10-14 q2 16-17 p3 19-23 q3 25-26.
BEGIN DATA
4,00 10 4,00 12 5,00 7
5,00 4 4,00 5 6,00 3
8,00 2 9,00 1 12,00 1
0,60 10 0,80 10 1,00 8
END DATA.
FORMAT p1 p2 p3 (F5.2).
 
* 2. Define a macro.
* ========================================= BEGIN MACRO.
* Macro computes Laspeyres and Paasche price indices.
DEFINE !priceindex ( price1 = !TOKENS(1)
/price2 = !TOKENS(1)
/quantity1 = !TOKENS(1)
/quantity2 = !TOKENS(1))
MATRIX.
GET data
/FILE = *
/VARIABLES = !price1 !price2 !quantity1 !quantity2
/NAMES = varnames
/MISSING = ACCEPT
/SYSMIS = OMIT.
COMPUTE p1 = T(data(:,1)) /*price yesterday*/.
COMPUTE p2 = T(data(:,2)) /*price today*/.
COMPUTE q1 = data(:,3) /*quantity yesterday*/.
COMPUTE q2 = data(:,4) /*quantity today*/.
COMPUTE las1 = p1 * q1 /*market volume yesterday laspeyres*/.
COMPUTE las2 = p2 * q1 /*market volume today laspeyres*/.
COMPUTE paa1 = p1 * q2 /*market volume yesterday paasche*/.
COMPUTE paa2 = p2 * q2 /*market volume today paasche*/.
COMPUTE volumina = {las1; las2; paa1; paa2}.
COMPUTE vollabel = {"Base Las"; "Tday Las"; "Base Paa"; "Tday Paa"}.
COMPUTE indices = {volumina(2)/volumina(1);volumina(4)/volumina(3)}.
COMPUTE indlabel = {"Laspeyres"; "Paasche"}.
/*Print results on screen*/
PRINT data
/FORMAT = "F5.2"
/TITLE = "(a) Data read:"
/SPACE = 1
/CNAMES = varnames.
PRINT volumina
/FORMAT = "F8.2"
/TITLE = "(b) Market volumina:"
/SPACE = 1
/RNAMES = vollabel.
PRINT indices
/FORMAT = "F8.4"
/TITLE = "(c) Price indices:"
/SPACE = 1
/RNAMES = indlabel.
END MATRIX.
!ENDDEFINE.
* ========================================= END MACRO.
 
* 3. Call the macro (edit variable names of price and quantity).
!priceindex price1 = p1 price2 = p2 quantity1 = q1 quantity2 = q2.
!priceindex price1 = p1 price2 = p3 quantity1 = q1 quantity2 = q3.
!priceindex price1 = p2 price2 = p3 quantity1 = q2 quantity2 = q3.

 



________________________________
Von: Pedro Campos <[hidden email]>
An: [hidden email]
Gesendet: Donnerstag, den 20. November 2008, 13:17:42 Uhr
Betreff: Index numbers with SPSS

Can you please tell me how to construct a Laspeyres or a Paasche index
with SPSS?



Regards

Pedro Campos

====================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
Mario Giesel
Munich, Germany