Determining the Number of Factors

Questions related to panel (pooled cross-section time series) data.
Frauke
Posts: 9
Joined: Mon May 16, 2011 8:43 am

Determining the Number of Factors

Unread post by Frauke »

Hello,

I want to analyse a money demand function for a panel of countries and would like to determine the number of factors to apply the PANIC methodology proposed by Bai and Ng (2004), A PANIC attack on unit roots and cointegration. Econometrica, 72, 1127–1177. Thus, I use the RATS procedure baing.scr (with fewer features since I work with RATS 6.3) to estimate the required number of factors of the set of countries for each variable (using the formulas in Bai and Ng, "Determining the Number of Factors in Approximate Factor Models", Econometrica, 2002, vol 70, pp 191-222).

First of all, I am not sure whether I have to define the original (differenced)* variables as matrix x or already estimated factors (using principal component analysis) or even both (I attach both as xls-file).
(Parameters: x = nper x nvar matrix of data. The factors are nper x 1 vectors)

Further, even though there are no error messages I get no output as I would expect from the code:

report(action=define)
report(atrow=1,atcol=1,align=center) "Factors" "PCP1" "PCP2" "ICP1" "ICP2"
report(atrow=2,atcol=1,fillby=cols) %seq(1,max)
report(atrow=2,atcol=2) stats
report(action=format,atcol=2,tocol=2,tag=min,special=onestar)
report(action=format,atcol=3,tocol=3,tag=min,special=onestar)
report(action=format,atcol=4,tocol=4,tag=min,special=onestar)
report(action=format,atcol=5,tocol=5,tag=min,special=onestar)
report(action=format,atrow=2,atcol=2,picture="*.#####",align=decimal)
report(action=show)

What might be the problem(s)?

Thanks in advance!
Frauke

*Following the PANIC methodology proposed by Bai and Ng (2004) I want to apply the method of principal components to the first differenced data.
Attachments
factors.xls
factors of a panel ot countries for M1, output, interest rate, wealth and exchange rate, respectively
(68.5 KiB) Downloaded 1062 times
moneydemand.xls
M1, output, interest rate, wealth and exchange rate in levels and first differences for a panel of countries
(528.5 KiB) Downloaded 1109 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Determining the Number of Factors

Unread post by TomDoan »

Frauke wrote:Hello,

I want to analyse a money demand function for a panel of countries and would like to determine the number of factors to apply the PANIC methodology proposed by Bai and Ng (2004), A PANIC attack on unit roots and cointegration. Econometrica, 72, 1127–1177. Thus, I use the RATS procedure baing.scr (with fewer features since I work with RATS 6.3) to estimate the required number of factors of the set of countries for each variable (using the formulas in Bai and Ng, "Determining the Number of Factors in Approximate Factor Models", Econometrica, 2002, vol 70, pp 191-222).

First of all, I am not sure whether I have to define the original (differenced)* variables as matrix x or already estimated factors (using principal component analysis) or even both (I attach both as xls-file).
(Parameters: x = nper x nvar matrix of data. The factors are nper x 1 vectors)

Further, even though there are no error messages I get no output as I would expect from the code:

report(action=define)
report(atrow=1,atcol=1,align=center) "Factors" "PCP1" "PCP2" "ICP1" "ICP2"
report(atrow=2,atcol=1,fillby=cols) %seq(1,max)
report(atrow=2,atcol=2) stats
report(action=format,atcol=2,tocol=2,tag=min,special=onestar)
report(action=format,atcol=3,tocol=3,tag=min,special=onestar)
report(action=format,atcol=4,tocol=4,tag=min,special=onestar)
report(action=format,atcol=5,tocol=5,tag=min,special=onestar)
report(action=format,atrow=2,atcol=2,picture="*.#####",align=decimal)
report(action=show)

What might be the problem(s)?

Thanks in advance!
Frauke

*Following the PANIC methodology proposed by Bai and Ng (2004) I want to apply the method of principal components to the first differenced data.
You indeed want to apply BaiNg to the first differenced data. This seems to work. I tested it with an older version of RATS.

Code: Select all

open data moneydemand.xls
data(format=xls,org=columns,sheet="dm1") 1 98 m1_au m1_cn m1_dk m1_fr m1_bd $
  m1_it m1_jp m1_nl m1_sd m1_sw m1_us
make x
# m1_au to m1_us
@baing(max=4,standardize) x
Frauke
Posts: 9
Joined: Mon May 16, 2011 8:43 am

Re: Determining the Number of Factors

Unread post by Frauke »

Thanks a lot!
Now it works without any problems.

However, can you please confirm that it is correct to include the original, i.e. not decomposed, data in x but not the already estimated factors?
Or to put it in another way: Implies baing.scr a principal component analysis?

Regards,
Frauke
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Determining the Number of Factors

Unread post by TomDoan »

Frauke wrote:Thanks a lot!
Now it works without any problems.

However, can you please confirm that it is correct to include the original, i.e. not decomposed, data in x but not the already estimated factors?
Or to put it in another way: Implies baing.scr a principal component analysis?

Regards,
Frauke
That's correct. You input the original set of data (in this case in differences). Once you've decided upon the number of components, you use either PRINCOMP or PRINFACTORS (both standard RATS procedures) to extract the desired principal components for the next step.
Frauke
Posts: 9
Joined: Mon May 16, 2011 8:43 am

Re: Determining the Number of Factors

Unread post by Frauke »

Thanks for the quick and informative reply!
Post Reply