Problem 1:
Applying a division by a common time series variable for all individuals e.g. CPI.
The SET instruction doesn't seem to work as the common variable is interpreted as
belonging to individual 1.
I have come up with the following
Code: Select all
compute nobs=176
declare vector[real] YD_r(nobs)
do i=0,nobs-16,16
do j=1,16
compute k=i+j
compute YD_r(k) = YD(k)/CPI(j)*CPI(16)
end do j
end do i
* converting vector to panel data
set yd_rt 1//1997:1 11//2012:1 = yd_r(t-1//1997:1+1)Problem 2: What is the most natural way of making up a panel of time differences?
It can be done within a double do loop structure similar as above, e.g.
Code: Select all
declare vector[real] dYD_r(nobs-11)
do i=0,nobs-26,15
do j=1,15
compute k=i+j
compute dYD_r(k) = log(YD_r(k+1)/YD_r(k))
end do j
end do i
Code: Select all
set dYD_rt 1//1998:1 11//2012:1 = dYD_r(t-1//1998:1+i)begins in 1997. I'm pretty sure that I'm overlooking something really simple.
Thanks, Yngvi