Hi
I am constructing an index with Panel data using Dynamic factor model (DFM).
I found this paper which I am following for the methodology: https://www.stata.com/meeting/2italian/Federici.pdf
Please help me with trouble shooting this issue I am facing and have already reached out for help from long time.
The commands were working till I got an error in page 11 (see below).
Two things:
First, it there something like e`k" (double quotes)? Someone whom I asked (statistician, without STATA knowledge) said it might mean the multiplication of three matrices like 3X1), (3X3), (1X3), where e`k" could mean transpose of eigenvector matrix, cov is covariance matrix, and e`k' is eigenvector matrix.
I wanted to know if this is correct?
When I run this, I get
Secondly, i thought maybe it should be `e`k''
Third, I tried the following with this error popping up:
Because similar code is being used in page no. 12 again.
Any and all help is needed.
P.S. I am new to STATA. I am doing this research as part of my internship and the organization has provided me with STATA v13
Please please desperately need help in figuring this out
I am constructing an index with Panel data using Dynamic factor model (DFM).
I found this paper which I am following for the methodology: https://www.stata.com/meeting/2italian/Federici.pdf
Please help me with trouble shooting this issue I am facing and have already reached out for help from long time.
The commands were working till I got an error in page 11 (see below).
Code:
local t=1
matrix ST=J(24,24,0)
forvalues i=1(27)2052 {
matrix num = J(1,1,0)
matrix C=A[`i'..(`i'+27-1),1...]
svmat C
matrix accum cov = C1-C24, deviations noconstant
matrix cov=cov/(r(N)-1)
matrix ST=ST+cov
drop C1-C24
forvalues k = 1/24 {
mat num = num + (`e`k''*cov*e`k')
}
mat I_`t' = num/trace(cov)
mat list I_`t'
local t = `t'+1
}
First, it there something like e`k" (double quotes)? Someone whom I asked (statistician, without STATA knowledge) said it might mean the multiplication of three matrices like 3X1), (3X3), (1X3), where e`k" could mean transpose of eigenvector matrix, cov is covariance matrix, and e`k' is eigenvector matrix.
I wanted to know if this is correct?
When I run this, I get
Code:
. local t=1
. matrix ST=J(24,24,0)
. forvalues i=1(27)2052 {
2. matrix num = J(1,1,0)
3. matrix C=A[`i'..(`i'+27-1),1...]
4. svmat C
5. matrix accum cov = C1-C24, deviations noconstant
6. matrix cov=cov/(r(N)-1)
7. matrix ST=ST+cov
8. drop C1-C24
9. forvalues k = 1/24 {
10. mat num = num + (e`k"*cov*e`k')
11. }
12. mat I_`t' = num/trace(cov)
13. mat list I_`t'
14. local t = `t'+1
15. }
(obs=27)
too few quotes
r(132);
Code:
. local t=1
. matrix ST=J(24,24,0)
. forvalues i=1(27)2052 {
2. matrix num = J(1,1,0)
3. matrix C=A[`i'..(`i'+27-1),1...]
4. svmat C
5. matrix accum cov = C1-C24, deviations noconstant
6. matrix cov=cov/(r(N)-1)
7. matrix ST=ST+cov
8. drop C1-C24
9. forvalues k = 1/24 {
10. mat num = num + (`e`''*cov*e`k')
11. }
12. mat I_`t' = num/trace(cov)
13. mat list I_`t'
14. local t = `t'+1
15. }
(obs=27)
*cov not found
r(111);
Code:
. local t=1
. matrix ST=J(24,24,0)
. forvalues i=1(27)2052 {
2. matrix num = J(1,1,0)
3. matrix C=A[`i'..(`i'+27-1),1...]
4. svmat C
5. matrix accum cov = C1-C24, deviations noconstant
6. matrix cov=cov/(r(N)-1)
7. matrix ST=ST+cov
8. drop C1-C24
9. forvalues k = 1/24 {
10. mat num = num + (e`k'*cov*e`k')
11. }
12. mat I_`t' = num/trace(cov)
13. mat list I_`t'
14. local t = `t'+1
15. }
(obs=27)
conformability error
r(503);
Any and all help is needed.
P.S. I am new to STATA. I am doing this research as part of my internship and the organization has provided me with STATA v13
Please please desperately need help in figuring this out

Comment