Announcement

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

  • #16
    Maybe it is a Win10 issue.Alas, I have a Win10 machine I could install R on but it doesn't have Stata.

    I can execute R scripts from within Stata via commands like

    ! "C:\Program Files\R\R-3.4.2\bin\x64\R.exe" CMD BATCH --vanilla lav_fe1.R

    But also try rsource.
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    Stata Version: 17.0 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #17
      Bruce mentioned

      runmixregls from http://fmwww.bc.edu/RePEc/bocode/r 'RUNMIXREGLS': module to run the MIXREGLS software from within Stata / This module runs the MIXREGLS mixed-effects location scale / software (Hedeker and Nordgren 2013) from within Stata. The / mixed-effects location scale model extends the standard two-level / random-intercept
      If that appeals to people, MIXREGLS is available for free.
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      Stata Version: 17.0 MP (2 processor)

      EMAIL: [email protected]
      WWW: https://www3.nd.edu/~rwilliam

      Comment


      • #18
        I tend to perform most tasks in Stata and go with R for a specific test.

        That said, whenever I wish to perform multiple tasks in both softwares, I do it separately, hence my potential troubles boil down to importing and exporting operations, so to speak.

        Indeed, by using RStudio, importing a .dta file from Stata is quite simple, and we can do it even by clicking on buttons, so down-to-earth is the process.

        Lying underneath, there is the - haven - package and the command - read_stata - , providing correct renditions easily, even when we "let it go" with default settings.
        Best regards,

        Marcos

        Comment


        • #19
          If you just want to convert the Stata dataset to R then 'save2rda' from http://www.radyakin.org/transfer/save2rda/ works very well.
          Martyn

          Comment


          • #20
            Here, we discussed on this particularity, I mean, using the SSC - save2rda - so as to save a .dta file as RData, then use it in R, or using RStudio, to import .dta files directly into R.

            Pros and cons were given.
            Last edited by Marcos Almeida; 05 Oct 2017, 06:54.
            Best regards,

            Marcos

            Comment


            • #21
              I'm the author of rcall. I use it on Windows 7 and 10, so there shouldn't be any problem with the path. One thing is for sure, if you have a issue with setting up the path, it has nothing to do with Stata. rcall just attempts to confirm that R exists in the defined path and returns an error otherwise. The simplest way to check that is to examine your path from the command line to make sure the path is correct.

              But here are a few things to do first:
              1. install rcall from GitHub. It's been over a year that I haven't updated any of my packages on SSC. The reason is simple, when the package is hosted on GitHub, any member of the community can add a feature or get involve to fix a bug, which is necessary to maintain a free software (already a few people have contributed to the package on GitHub). I also wrote a package for searching, installing, and uninstalling Stata packages from GitHub, to make the task easier.
              2. Rcall was renamed to rcall due to the request of Stata Journal. I shouldn't have used a capital letter, so that was my mistake. Once you install it from GitHub, the older name will no longer work.
              Hope this helps!
              ——————————————
              E. F. Haghish, IMBI, University of Freiburg
              [email protected]
              http://www.haghish.com/

              Comment


              • #22
                Thanks Haghish. I would suggest periodically updating the SSC version, since that is where most people will find it.

                EDIT: I installed github and rcall without problems. At first I wasn't sure what to do but the online documentation is very clear on installation.
                Last edited by Richard Williams; 06 Oct 2017, 05:26.
                -------------------------------------------
                Richard Williams, Notre Dame Dept of Sociology
                Stata Version: 17.0 MP (2 processor)

                EMAIL: [email protected]
                WWW: https://www3.nd.edu/~rwilliam

                Comment


                • #23

                  Hagish et al.,

                  I believe I found the source of the problem I was having with the older SSC version of Rcall (now rcall on GitHub) not finding R.

                  My R program is installed under Windows 10 (64-bit) in the Q:\R folder. By default R creates a subdirectory in that folder with the current version number following R-, so R on my system it is located in Q:\R\R-3.4.2 .

                  In reviewing the code, I found that the older SSC version of Rcall was searching through subdirectories under the main directory to find the most recent version of R. In my case, I had other subdirectories under Q:\R. For example, I had Q:\R\R-Studio and Q:\R\Rtools. I believe the code was confusing those subdirectories in its search for the most recent version of R.

                  I moved R to O:/R/R-3.4.2 and did not install any other programs in the O:\R folder. That seemed to solve the problem.

                  I will now get the updated version of rcall from GitHub.

                  Thanks, Hagish, Richard, and all others who offered help in solving my issue.

                  Red Owl
                  Stata/IC 15.0
                  Windows 10 (64-bit)

                  Comment


                  • #24
                    Richard, I take it you used the command shown on this page to install rcall from Github. The command shown there is:

                    Code:
                    net install Rcall, replace from("https://raw.githubusercontent.com/haghish/Rcall/master/")
                    In order to make it work, I had to change Rcall to rcall (as suggested by E.F. Haghish in #21):

                    Code:
                    net install rcall, replace from("https://raw.githubusercontent.com/haghish/Rcall/master/")
                    Just thought I'd mention it, in case anyone else was running into problems with the command as shown on the web-page.

                    --
                    Bruce Weaver
                    Email: [email protected]
                    Web: http://sites.google.com/a/lakeheadu.ca/bweaver/
                    Version: Stata/MP 18.0 (Windows)

                    Comment


                    • #25
                      I suspect the page Bruce listed is out of date:

                      http://www.haghish.com/packages/Rcall.php

                      The page I saw for rcall was

                      https://github.com/haghish/rcall


                      I used the commands given in the links for post 21. First I installed github and then used it to install rcall:


                      net install github, from("https://haghish.github.io/github/")

                      github install haghish/rcall
                      -------------------------------------------
                      Richard Williams, Notre Dame Dept of Sociology
                      Stata Version: 17.0 MP (2 processor)

                      EMAIL: [email protected]
                      WWW: https://www3.nd.edu/~rwilliam

                      Comment


                      • #26
                        Periodically there are complaints about this or that command being slow in Stata, such as reshape. Has anybody checked whether reshape or other commands are faster in R? It might be relatively easy to call R for some things.
                        -------------------------------------------
                        Richard Williams, Notre Dame Dept of Sociology
                        Stata Version: 17.0 MP (2 processor)

                        EMAIL: [email protected]
                        WWW: https://www3.nd.edu/~rwilliam

                        Comment


                        • #27
                          Well, to add to the confusion, I'm having something odd here, too. I just installed -rcall- on a Windows 7 machine running Stata 14.2
                          Code:
                          rcall describe
                          reports that the R Path is /usr/bin/R
                          This directory certainly does not exist on my machine, yet rcall sucessfully makes calls to R

                          On the other hand, when I try to set the path to R:
                          Code:
                           rcall setpath "C:/Program Files/R/R-3.3.1/bin"
                          That fails with an r(601) file not found error.
                          Go figure ...

                          So, -rcall- reports a bogus path, which does work and refuses to accept a valid path. Clearly something is going on that I don't understand.
                          Absolutely no complaints, as -rcall- is a great contribution, but it would be nice to figure out what's going on.

                          Comment


                          • #28
                            Mike, are you using the rcall from ssc or the rcall from GitHub? See post 25.

                            As a sidelight R is up to 3.4.2 now.
                            -------------------------------------------
                            Richard Williams, Notre Dame Dept of Sociology
                            Stata Version: 17.0 MP (2 processor)

                            EMAIL: [email protected]
                            WWW: https://www3.nd.edu/~rwilliam

                            Comment


                            • #29
                              After installing rcall through `ssc install' command, getting message unable to change to \bin
                              r(170);
                              at time of running R command from Stata (version 13). I am working on R 3.3.3 and its path is defined in windows 7 (sp1 32 bit) environment. I have installed readstata13 pkg at R.

                              Comment


                              • #30
                                Nand Kishore and others, make sure you have the latest version of rcall, which is on GitHub, not SSC. Again the commands are

                                Code:
                                net install github, from("https://haghish.github.io/github/")
                                github install haghish/rcall
                                I don't know if that will solve your problem but it is always good to make sure you have the most current version of software because bugs may have already been fixed.

                                Again I would suggest to haghish that he either put the most current version on SSC or pull it from SSC completely. Authors who prefer to keep programs on their own sites can contact Stata Corp to have their personal pages included in search/findit results,
                                -------------------------------------------
                                Richard Williams, Notre Dame Dept of Sociology
                                Stata Version: 17.0 MP (2 processor)

                                EMAIL: [email protected]
                                WWW: https://www3.nd.edu/~rwilliam

                                Comment

                                Working...
                                X