Announcement

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

  • #16
    #15

    1 What it says!

    2 Already answered in earlier posts.

    Comment


    • #17
      Originally posted by Nick Cox View Post
      As there is a function sqrt() the problem will be something related. It's my guess that one or more of the arguments fed to an expression that includes a sqrt() call is undefined, and Stata is puzzled.

      You haven't given us a reproducible example but you're already flagging a dataset that might be problematic. If you


      Code:
      set trace on
      set traced 1
      and run your code again and show us the few lines of output before it stops, then we will see precisely what the program is choking on.
      Hello
      I tried tody what you suggested to solve this matter, so far I don't know how to solve this problem?

      Comment


      • #18
        Atif Awad Sympathy for your problem, but #17 doesn't tell us anything new or specific about your set-up, so it seems difficult to add to previous suggestions.

        Comment


        • #19
          Hello Cox
          As you suggested, I used codes
          set trace on set traced 1 below is what i get, do undersand somthing?
          unknown function *sqrt()
          if "`abs'" != "" {
          mat `ABS'[`i',`j'] = abs(`r(rho)')
          }
          if "`show'" != "" {
          mat `COR'[`i',`j'] = `r(rho)'
          }
          }
          else {
          qui spearman __e`i' __e`j'
          mat `E'[`i',`j'] = (`r(rho)')^2
          if "`friedman'" != "" {
          mat `F'[`i',`j'] = `r(rho)'
          }
          if "`show'" !="" | "`abs'"!="" {
          qui corr __e`i' __e`j'
          if "`abs'" != "" {
          mat `ABS'[`i',`j'] = abs(`r(rho)')
          }
          if "`show'" != "" {
          mat `COR'[`i',`j'] = `r(rho)'
          }
          }
          }
          }
          }

          Comment


          • #20
            In xtcd (SSC) the only point at which sqrt() is invoked is in this block of code


            Code:
                mat `E'`name'[`i',`j'] = `r(rho)'*sqrt(`r(N)')
                                mat `Nobs'`name'[`i',`j'] = `r(N)'
                                mat `ABS'`name'[`i',`j'] = abs(`r(rho)')
                                mat `COR'`name'[`i',`j'] = `r(rho)'
            If a previous correlation goes well then
            r(rho) r(N) will be defined but if they are not defined Stata gets puzzled. It seems likely that some other deeper problem is implied but to get Stata to execute the entire command a minimum hack might be

            Code:
                capture {
                       mat `E'`name'[`i',`j'] = `r(rho)'*sqrt(`r(N)')
                       mat `Nobs'`name'[`i',`j'] = `r(N)'
                       mat `ABS'`name'[`i',`j'] = abs(`r(rho)')
                       mat `COR'`name'[`i',`j'] = `r(rho)'
            }
            except that (1) I haven't tested for this (2) I have no idea what other problems may lurk downstream (3) This is speculation and I don't take responsibility (4) email the author (who has moved since the code was posted on SSC, so you will have to Google for his address

            Very similar comments apply to
            xtcsd (SSC) so far as I can see.

            These are community-contributed (user-written) commands. You paid nothing for them and everything hinges on what support the authors may give if you are unable to fix the code yourself.

            Comment


            • #21
              Have you tried using -xtcdf- instead?

              Comment


              • #22
                Hi everyone,

                i m facing the same problem of error 133 during the cross sectional dependence test in stata/MP 14.2

                xtcsd, pesaran abs

                unknown function *sqrt()

                r(133);


                can anyone help me to resolve the issue please..???

                Comment


                • #23
                  #20 is already the best answer I have.

                  Comment


                  • #24
                    Hi I am facing a similar issue,. On running xtscd, Pesaran I am getting unknown function *sqrt(). My data is unbalanced panel with N >T.Please suggest

                    Comment


                    • #25
                      Originally posted by Nick Cox View Post
                      xtcd is from SSC, as you are asked to explain. What you show us has no obvious relation to the problem as the square root function isn't shown.

                      I think what's happening is that your data don't yield a particular correlation and that's not being trapped by the code.

                      I'd suggest contacting the author directly (Google for his current address). He's likely to want to see your dataset.
                      i have the same problem with sqrt()
                      - mat `E'[`i',`j'] = `r(rho)'*sqrt(`r(N)')
                      = mat __000003[1,7] = *sqrt(0)
                      unknown function *sqrt()
                      if "`abs'" != "" {
                      mat `ABS'[`i',`j'] = abs(`r(rho)')
                      }
                      if "`show'" != "" {
                      mat `COR'[`i',`j'] = `r(rho)'
                      }
                      }
                      else {
                      qui spearman __e`i' __e`j'
                      mat `E'[`i',`j'] = (`r(rho)')^2
                      if "`friedman'" != "" {
                      mat `F'[`i',`j'] = `r(rho)'
                      }
                      if "`show'" !="" | "`abs'"!="" {
                      qui corr __e`i' __e`j'
                      if "`abs'" != "" {
                      mat `ABS'[`i',`j'] = abs(`r(rho)')
                      }
                      if "`show'" != "" {
                      mat `COR'[`i',`j'] = `r(rho)'
                      }
                      }
                      }
                      }
                      }
                      Can anyone explain and give me solution to fix this

                      Comment


                      • #26
                        Jennie Nguyen You're already quoting the explanation of your problem. xtcd is a community-contributed command with this known bug or limitation mentioned several times in this thread. The solutions are (1) a user with enough skill can clone the command and fix the code (2) people can contact the author (3) people can seek an alternative command. I don't work in this territory and so cannot advise or help further. Sorry if that is disappointing, but it's one thing to spot a problem and quite a different thing to know what a command should do instead. (I am not an econometrician.)

                        Comment


                        • #27
                          The 3rd line of the trace in #25 shows that the problem is that "`r(rho)'" is evaluating to an empty string, the problem isn't with "sqrt". With the macro evaluating to nothing, the Stata parser thinks the right hand side of the assignment is "*sqrt(0)" (notice the *) instead of something times sqrt(0). This is probably something for the author of the procedure to deal with, but no harm looking at the .ado to see if you can tell more.

                          Comment


                          • #28
                            Hi i faced the same problem rescently unknown function *sqrt() while using the stata command xtcd i later solved it as i checked the data i was working with had fewer observations that i had dropped as they were missing retaining them and proceed solved the problem as it works on a larger sample

                            Comment


                            • #29
                              Hi i faced the same problem recently unknown function *sqrt() while using the stata command xtcd i later solved it as i checked the data i was working with had fewer observations that i had dropped as they were missing retaining them and proceed solved the problem as it works on a larger sample

                              Comment


                              • #30
                                Originally posted by Nick Cox View Post
                                As there is a function sqrt() the problem will be something related. It's my guess that one or more of the arguments fed to an expression that includes a sqrt() call is undefined, and Stata is puzzled.

                                You haven't given us a reproducible example but you're already flagging a dataset that might be problematic. If you


                                Code:
                                set trace on
                                set traced 1
                                and run your code again and show us the few lines of output before it stops, then we will see precisely what the program is choking on.
                                Dear expert! Nick Cox
                                I am facing a similar problem and getting the following output before it stops. It would be very helpful if you could suggest some ways out.
                                Attached Files

                                Comment

                                Working...
                                X