- x
y
z
and would like to set a new one
- x
x
x
y
y
y
y
z
z
using an existing dummy
- 1
1
1
2
2
2
2
3
3
For some reason that is not immediately apparent to me this sets all values of expanded to 0 (even though original has nonzero values).TomDoan wrote:set expanded = original(fix(dummy(t)))
Yes, I do get them. But I'm not sure why we are using fix in the first place. I was expecting we may need to use a loop that takes the first value (x) from the original series and copies it in the first three rows of the expanded series, then takes the second (y) value from the original and copies it in the next four rows of the expanded and so on.TomDoan wrote:do you get the three values that you want?
Code: Select all
OPEN DATA "/Users/[...].xls"
CALENDAR(D) 2001:1:1
DATA(FORMAT=XLS,ORG=COLUMNS) 2001:01:01 2014:12:31 XR3M XR0 RATE3M RATE USRATE USRATE3M
* set financial openness from daily data
set devcip_d = (1+usrate3m/100)-(1+rate3m/100)*(xr0/xr3m)
set fi_d = 1/exp((abs(devcip_d)))
* series transformations (growth rates)
dofor i = XR3M to USRATE3M
compute [label] dlogs = "dl"+%l(i)
set %s(dlogs) = log(i{0}/i{1})
* stats %s(dlogs)
enddofor i
* set monthly dummy and indicator from daily data
set yymm = %year(t)*100+%month(t)
panel(group=yymm,id=yymmvalues)
* set exchange rate stability (ers)
set mysd 1 %size(yymmvalues) = %na
do i=1,%size(yymmvalues)
stats(noprint,smpl=(yymm==yymmvalues(i))) dlxr0
compute mysd(i) = sqrt(%variance)
end do i
set mysd2 = mysd(fix(yymm(t)))
set ers = 1/(1+mysd2)

Code: Select all
set yymm = %year(t)*100+%month(t)
panel(group=yymm,id=yymmvalues)
do i=1,%size(yymmvalues)
stats(noprint,smpl=(yymm==yymmvalues(i))) dlxr0
set(smpl=(yymm==yymmvalues(i))) mystd2 = sqrt(%variance)
end do i