Announcement

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

  • Path to Stata Executable on Linux?

    Hi Everyone --

    I am just curious if there is a way within stata to determine what the path is to the stata executable file, or even if there is a way to determine this path from the command line in Linux.

    Best,

    Matthew J. Baker

  • #2
    You want the sysdir command. The output of help sysdir is not as useful as the full documentation in the [P] Stata Programming Reference Manual PDF included in your Stata installation. Here's a sample of its use to meet your needs, albeit run on a Mac rather than Linux.
    Code:
    . sysdir
       STATA:  /Applications/Stata/
        BASE:  /Applications/Stata/ado/base/
        SITE:  /Applications/Stata/ado/site/
        PLUS:  /Users/lisowskiw/Library/Application Support/Stata/ado/plus/
    PERSONAL:  /Users/lisowskiw/Library/Application Support/Stata/ado/personal/
    OLDPLACE:  ~/ado/
    
    . dir "`c(sysdir_stata)'"
    
    total 32
    drwxrwxr-x   3 wwwwwww  admin   102 Nov 17 19:21 StataSE.app/
    drwxrwxr-x   3 root     admin   102 Jun 19 14:42 ado/
    -rw-rw-r--   1 root     admin  6443 Jun 19 14:42 auto.dta
    drwxrwxr-x  32 root     admin  1088 Nov 17 19:23 docs/
    -rw-rw-r--   1 root     admin    24 Jun 19 14:42 isstata.150
    -rw-rw-r--   1 wwwwwww  admin    73 Jul  8 15:58 stata.lic
    drwxrwxr-x   7 root     admin   238 Nov 17 19:23 utilities/

    Comment


    • #3
      William Lisowski --

      Thanks! That's exactly what I needed.

      Best,

      Matthew J. Baker

      Comment


      • #4
        Hi everyone,

        I am trying to run an eventstudy (using the command eventstudy2 by Thomas Kaspereit, 2015. "EVENTSTUDY2: Stata module to perform event studies with complex test statistics," Statistical Software Components S458086, Boston College Department of Economics, revised 01 Nov 2018.) on a Linux server. Because of the parallel option (based on George Vega Yon & Brian Quistorff, 2012. "PARALLEL: Stata module for Parallel Computing," Statistical Software Components S457527, Boston College Department of Economics, revised 29 Aug 2015.) in eventstudy2 which facilitates the computation Stata needs to know the path to the Stata executable file.

        I receive the error message "Can not set Stata directory, try using -statapath()- option" when I use the parallel option." Thus, it seems that Stata fails to find the path to the executable file automatically. I tried use the statapah() option to set the path by hand in the eventstudy2 ado file. This works perfectly on my local Windows machine when I use sysdir and insert the path to the statapath option [1] (However, it only works when I additionally specify the executable file "StataMP-64.exe"):


        [1] parallel setclusters `pclusters', statapath(C:/Program Files (x86)/Stata15/StataMP-64.exe)

        Unfortunately, I am not able to find theright path to the executable stata file on the Linux server. I also used the sysdir command (as mentioned above, thanks to William Lisowski) to be able to find the path to the installation folder and used that for the path in the statapath() option:


        [2] parallel setclusters `pclusters', statapath(/applications/stata/13/)
        [3] parallel setclusters `pclusters', statapath(/applications/stata/13/stata-mp)


        So I just copied the result of sysdir in [2] for the statapath option which nevertheless results in the same error when I run the eventstudy2 command. I also tried to specify the executable file in the statapath option by adding the executable file (so in line with the Windows path that actually worked on my local Windows machine) of the Stata version I am working with on the server, which is the tag "stata-mp" in [3]. But unfortunately the error message recurs. I tried to learn more about using Stata on Linux, but I am still not able to come up with a solution for my problem.

        Kind regards,
        Kurt Krabel

        Comment

        Working...
        X