Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with dynamic factor analysis: too few quotes r(132)

    Hello mates.


    I'm trying to run a factor dynamic analysis , but I'm having a problem. I am following the step by step of paper "Dynamic Factor Analysis with STATA".

    Paper's link: http://www.stata.com/meeting/2italian/Federici.pdf

    However, the following problem arises:

    forvalues i=1/3{
    mat e`i'=J(3,1,0)
    }

    forvalues i=1/3{
    forvalues j=1/3{
    mat e`i'[`j',1]=eigenvectors[`j',`i']
    }
    }

    local t=1
    matrix ST=J(3,3,0)

    forvalues i=1(558)3348 {
    matrix num=J(1,1,0)
    matrix C=A[`i'..(`i'+558-1),1...]
    svmat C
    matrix accum cov=C1-C3, deviations noconstant
    matrix cov=cov/(r(N)-1)
    matrix ST=ST+cov
    drop C1-C3
    forvalues k=1/3{
    mat num = num+(e`k" * cov * e`k')
    }
    mat l_`t'=num/trace(cov)
    mat list l_`t'
    local t=`t'+1
    }


    too few quotes
    r(132);


    I believe the problem is at following command line:
    mat num = num+(e`k" * cov * e`k')

    Could anyone help me, please?

    I'm using STATA/MP 13.0.

    Best regards.
    Gre Vitor
    Last edited by Gre Vitor; 17 Jun 2016, 14:00.

  • #2
    My guess is that the right quote used to expand the local macro k (i.e. `k') followed by a transpose operator (same right quote character) got converted to a double quote in the PDF. Try

    Code:
    mat num = num+(e`k'' * cov * e`k')

    Comment


    • #3
      Dear Robert Picard,

      You are right! I really need to thank you, your help was essential. It was a small mistake I made, I really could not find.

      God bless you!

      Best regards.

      Comment


      • #4
        Dear Gre Vitor
        I am running a dynamic factor analysis,too.Still trying to figure out the procedure.
        I don't understand when Federici wrote:


        mat zi=J(1,3,0)
        forvalues i=1/13 {
        mat z=J(1,3,0)
        forvalues k=`i'(13)117 {
        mat z=z+A[`k',1...]
        }
        mat z=z/7
        mat zi=zi\z
        }
        mat zi=zi[2...,1...]
        mat list zi

        " mat z=z/7" why 7 ? means time period(which is 9) minus 2?

        Can you help me?

        Thanks

        Charlie Jiang

        Comment

        Working...
        X