Announcement

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

  • installing rangestat on remote platform (not connected to internet)

    Hi all, I am trying to install rangestat. I am using stata on a remote platform that belongs to another organisation which isn't connected to the internet.

    So to install rangestat - I can not use the code
    ssc install rangestat - as this wouldn't work

    The only way to get round it, is by installing rangestat on my personal subscription on my home computer - emailing this to the owner of the remote platform who then uploads the files on the shareplatform.

    How can I get Stata to install rangestat but tell stat that the rangestat files are actually stored in my folder rather than connecting to the internet..


    Perhaps I just run the rangestat - do file within my code do file so Stata can detect it ?

  • #2
    I'm not sure how to do this. -rangestat- itself calls on some -mata- code, and that, in turn, may require installing some things in directories you don't have access to. It may be possible, but I just don't know. If somebody else here knows enough about this aspect of -rangestat-, I hope they will respond.

    But if nobody does, going out on a limb and inferring that the reason you want to install -rangestat- is to run some code to solve a problem in a different recent thread, here is an alternate version of that code that does not use -rangestat- or any other community-contributed programs. It will give you the same results if your data set is not too large. (If your data set is very large, it will exhaust available memory. If you encounter this problem, you can get around it by breaking up your data set into several subsets, just being sure that any given hospitalid's data is all contained in the same subset, run this code on each subset separately, and then -append- all the results together.) Note: It is also possible that your data set will be small enough to run the code, but large enough that it will take a very long time. So be patient.

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float colorectal str3 hospitalid float(MI date2)
      0 "12A" 0 22252
    112 "12A" 1 22253
      0 "13A" 0 22678
      0 "13A" 1 22665
    113 "13A" 0 22619
    114 "13A" 0 22646
    115 "14A" 0 22720
      0 "14A" 1 22734
    116 "14A" 0 22705
      0 "14A" 0 22705
    end
    format %td date2
    
    assert inlist(MI, 0, 1)
    gsort hospitalid -date2
    by hospitalid: gen next_colorectal_date = .
    by hospitalid: replace next_colorectal_date = cond(colorectal[_n-1], date2[_n-1], ///
        next_colorectal_date[_n-1]) if _n > 1
    format next_colorectal_date %td
    
    gen lower = cond(colorectal, date2, 1)
    gen upper = cond(colorectal, min(date2+45, next_colorectal_date-1), 0)
    
    
    preserve
    keep if MI
    keep hospitalid date2
    sort hospitalid date2
    rename date2 MI_date
    tempfile MI_dates
    save `MI_dates'
    restore
    
    gen long obs_no = _n
    joinby hospitalid using `MI_dates'
    by obs_no, sort: egen wanted = max(inrange(MI_date, lower, upper))
    by obs_no, sort: keep if _n == 1
    replace wanted = . if !colorectal
    sort hospitalid date2
    drop MI_dates obs_no lower upper
    I will spare you my long rant about the insane lengths that some hospital IT departments have been driven to in the name of securing their computing infrastructure, at the cost of making it difficult or impossible for authorized users to do legitimate work.

    Comment


    • #3
      I don't know what to say about #1 except that the Mata code used by rangestat is all included in the ado code, except insofar as some examples use other community-contributed code as detailed.

      How far the "organisation" computer can see your "personal" computer is surely between you and the organisation, so I don't understand what advice we can give.

      Full disclosure: I am listed as second author of rangestat, and did contribute code and documentation, but the overwhelming credit belongs to the first author, Robert Picard.

      Comment


      • #4
        Do I run the ado file on my do file with code to use rangestat ?
        And run everything together ?

        as I cant type ssc install rangestat as its not connected to the internet.

        Comment


        • #5
          Sorry. but I don't understand #5. rangestat.ado as a file defining rangestat as a command must be visible to any code you write that calls it. Using ssc isn't essential if someone else emails you the file, and if that is a solution, then rangestat.sthlp might as well be sent too.

          Comment


          • #6
            I don't quite understand what your arrangement is for this remote system. If it has no internet connection, how do you manage to access it remotely? Anyway, I'm going to assume that what you mean is that the system blocks users from establishing internet connections of their own. But I assume you have some way of putting files into that system so that it can work with, for example, your data and your do-files.

            So try this. I ran -ssc desc rangestat- and I see that the package is contained in three files: rangestat.ado, rangestat_run.ado, and rangestat.sthp. Use the -findfile- command to locate these on your computer (not the remote system, your own personal computer where you presumably have -rangestsat- installed). Copy those files to a portable storage device such as a flash drive. Bring it to the computer that you use to access the remote system. Launch Stata and run the command -sysdir-. Look for the line of output you get that says PERSONAL: and note what directory is listed there. Try to copy the three files from the portable storage device to that directory. If the system lets you do that, then you are done and ready to use -rangestat-. Moreover, with this method of installation, -rangestat- will continue to be available to you whenever you use that system.

            If the system will not let you copy the files there, then copy the files to whatever directory your do-file is located in. If you can run the do-file from there, then you should be able to use -rangestat- from within that do-file. The drawback to this approach is that -rangestat- will only be available when that directory is your current working directory: if you run a do-file from some other directory, Stata will not recognize -rangestat-.

            It may be that there are details of how your remote system works that prevent you from doing this. In that case, I do not now what else to do. I can tell you that I have occasionally worked on a remote system that sounds a bit like yours: users are not permitted to establish internet connections, although they do access the server through a VPN over the internet. That system did permit me to copy files from drives on my own computer to some directories (those to which I had write acess), and I occasionally installed unofficial Stata ado files in the way I just described. But, again, the devil is in the details, so it might not work for you. Good luck!

            Added: Crossed with #5.

            More Added: My instructions here assume that you have a computer of your own that you fully control, and that has Stata on it, and that you have already installed -rangestat- there. But you never say that is the case. If your only computer with Stata is the remote one, I will be happy to email you the three -rangestat- files. In that case, you can private message me here at Statalist with your email address and I will send them there.
            Last edited by Clyde Schechter; 29 Nov 2022, 17:37.

            Comment


            • #7
              Dear Clyde Schechter thank you so much this worked by dragging the file into the Personal drive.
              Rangestat is an excellent command and thanks for explaining how the interval part works! This should feature in help rangestat !

              Comment

              Working...
              X