Announcement

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

  • #16
    Thanks. So in conclusion
    1. there is no error called "too many numeric literals"
    2. you aclaim that st.var() does not return the correct values. I highly doubt that. What I need is a reproducible example from you. That is, you use a dataset from Stata and while using the st.var to create a vector in R, show that the values in the vector do not match the dataset. Please upload the do-file here and I will look into that to see why you are getting strange results.
    Just for clarification, the st.var() takes the values row by row and creates a vector. It converts a Stata variable to an R vector. So the observations must remain in the same order and of course, the same values. That is what I get on my machine. I will only be able to validate your claim if you make it reproducible, in a Stata do-file, using a Stata dataset or any alternative from the internet that I can load within Stata.
    ——————————————
    E. F. Haghish, IMBI, University of Freiburg
    [email protected]
    http://www.haghish.com/

    Comment


    • #17
      Thanks, I'll try to do it. Also I updated Stata 14.2 now to a new version. I follow what is happening. But still the st.var is not working right. St.mat, st.data are working fine. I sent already values how st.var convert my year values, for example 1995 went to value 19951, 1998 -> 19952 etc. Maybe this is happening only our stata installation and operating system (win 7).

      Comment


      • #18
        Click image for larger version

Name:	Capture.PNG
Views:	3
Size:	8.2 KB
ID:	1365268

        I send what happens when I try sent my year variable to R using st.var. Maybe this is happening only in my Stata version of the Stata environment. Values are different obviously. This probably not due to Rcall at all. Z has a value 19951 when the original value is 1995...
        Attached Files

        Comment


        • #19
          I can only help you if you provide what I asked for... That is necessary to debug the software.

          Originally posted by haghish View Post
          Thanks. So in conclusion
          1. there is no error called "too many numeric literals"
          2. you aclaim that st.var() does not return the correct values. I highly doubt that. What I need is a reproducible example from you. That is, you use a dataset from Stata and while using the st.var to create a vector in R, show that the values in the vector do not match the dataset. Please upload the do-file here and I will look into that to see why you are getting strange results.
          Just for clarification, the st.var() takes the values row by row and creates a vector. It converts a Stata variable to an R vector. So the observations must remain in the same order and of course, the same values. That is what I get on my machine. I will only be able to validate your claim if you make it reproducible, in a Stata do-file, using a Stata dataset or any alternative from the internet that I can load within Stata.
          ——————————————
          E. F. Haghish, IMBI, University of Freiburg
          [email protected]
          http://www.haghish.com/

          Comment


          • #20
            Code:
            clear
            input int Tilastointivuosi
            1995
            1998
            1996
            2005
            1996
            2006
            1996
            2004
            1996
            2012
            end
            
            R: z<-st.var( Tilastointivuosi)
            R: z
            g sss= Tilastointivuosi
            R: z2<-st.var( sss )
            R: z2

            First z is R: z
            [1] 1995 1998 1996 2005 1996 2006 1996 2004 1996 2012

            but the same data in z2 is

            R: z2
            [1] 19951 19952 19953 19954 19955 19956 19957 19958 19959 199510


            So what later command do is taking the first value of var Tilastointivuosi and copying it and putting this order number 1 2 3 to the end. So obviously there is some kind of error in my stata at least.

            Comment


            • #21
              Hi - if anyone *does* know what "too many numeric literals" means in this context, I would really appreciate knowing, too. I am getting the same error. Here is a simulated example:

              Code:
              clear all  
              matrix M = 0, 0  
              matrix V = (1, .5 \ .5, 1)
              drawnorm e u, n(1000) cov(V) means(M) /* variable version */  
              mkmat e, matrix("e")                   /* vector version */  
              rcall: e <- st.matrix(e)             /* R version fails */
              After the last line, I get the error "too many numeric literals".

              Comment


              • #22
                I cannot reproduce the error in #21. I am using Stata/MP 15.1 for Windows (64-bit x86-64) and Rcall version 2.3.0. Leah Bevis Which version of Stata and Rcall do you use?

                Comment


                • #23
                  Hi Anders --- I'm using Stata 14.2 and R 3.4.3. I have no idea what caused the strange errors, but I DID receive advice to use the code rcall clear, which apparently clears the R-related memory in Stata. This worked, even though restarting Stata completely had not worked. Odd. So I think something had gone wrong, unclear what, but at least this clears the problem and allows one to start over. However, I then realized that apparently there is a max limit on matrix size that you can load into R using rcall... so on to the next problem...

                  Thanks for your reply!

                  Comment


                  • #24
                    Originally posted by Leah Bevis View Post
                    Hi Anders --- I'm using Stata 14.2 and R 3.4.3. I have no idea what caused the strange errors, but I DID receive advice to use the code rcall clear, which apparently clears the R-related memory in Stata. This worked, even though restarting Stata completely had not worked. Odd.
                    Restarting Stata does not influence the parallel R session. But seeing what you went through, makes me wondering this might happen more often, when people avoid using rcall clear before starting a new interactive R session. So I will update the the package in the next release to erase the interactive R session if Stata is restarted...
                    ——————————————
                    E. F. Haghish, IMBI, University of Freiburg
                    [email protected]
                    http://www.haghish.com/

                    Comment

                    Working...
                    X