Announcement

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

  • too few quotes r(132) error

    Code:
    . 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);
    Can someone please help in how to solve this problem?
    I am on version 13

  • #2
    look at line 10 where you have a double quote after the first "k" rather than the single right quote

    Comment


    • #3
      Following @Rich Goldstein's point, I guess wildly that you may want instead

      Code:
       
        mat num = num + ((e`k')' * cov * e`k')
      where care may be needed to keep the transpose syntax separate from the local macro name.

      Comment


      • #4
        Nick, is there an extra ' after the ( ?

        Comment


        • #5
          Yes; as said I am guessing wildly that Tina wants to transpose a vector.

          Comment

          Working...
          X