On Tue, 13 Jul 2010, Artur T. wrote:
is there a simple way to generate a index series of a variable, e.g.
Lapeyres (year x =100) or Paasche??
At the moment I use a spreadsheet to construct it easily but this
requires the ex- and import of the series of interest every time...
Not checked, but something like this?
<script>
function series paasche_index (list P, list Q, int base)
matrix MP = {P}
matrix MQ = {Q}
matrix Num = sumr(MP .* MQ)
matrix Den = sumr(MP[base,] .* MQ)
series ret = 100 * (Num ./ Den)
return ret
end function
</script>
I'm assuming list P contains k price series and list Q contains
k quantity series.
Allin Cottrell