Page 1 of 1

X-11 and Panel data

Posted: Wed Jul 08, 2020 9:23 pm
by cyang0922
Hi Tom,

How can I perform a seasonal adjustment on a panel data set with 29 economies from 2002:Q1-2019:Q4 using the X11 command?
I've tried the following code:

Code: Select all

cal(panelobs=72, q) 2002:1
data(format=xls,org=columns,sheet="data") 1//2002:1 29//2019:4 rgdp

do i=1,29
x11(mode=mult,adjusted=sa_rgdp,factors=fact_rgdp) rgdp i//2002:1 i//2019:4
end do
But that doesn't seem to work at all. I still receive error message X1101, which means that X11 can take monthly or quarterly series only.

Re: X-11 and Panel data

Posted: Fri Jul 10, 2020 11:51 am
by TomDoan
You have to copy it into straight quarterly data series and then re-form the output series:

Code: Select all

cal(panelobs=72, q) 2002:1
data(format=xls,org=columns,sheet="data") 1//2002:1 29//2019:4 rgdp

dec vect[series] rgdps(29) sa_rgdps(29) fact_rgdps(29)
do i=1,29
   move rgdp i//2002:1 i//2019:4 rgdps(i) 1
end do i
cal(q) 2002:1
do i=1,29
   x11(mode=mult,adjusted=sa_rgdps(i),factors=fact_rgdps(i)) rgdps(i) 2002:1 2019:4
end do i
pform sa_rgdp
# sa_rgdps
pform fact_rgdp
# fact_rgdps
cal(panelobs=72, q) 2002:1

Re: X-11 and Panel data

Posted: Sun Jul 12, 2020 8:34 pm
by cyang0922
Thank you, Tom. This is extremely helpful.