Announcement

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

  • STATA and REDcap

    As we know Redcap is a open source electronic data collection module developed at Vanderbilt university. There are about 1700 institutions across the globe using this module. One of these is my university. Redcap offers API for different task programmed in different Programming languages. Is a way to for STATA to use the API and create automated tasks.

  • #2
    I'm not sure whether this is a general feature of REDCap or is peculiar to the particular implementation, but this site states that among REDCap's advantages is "Export survey results to common data analysis packages - Export your data to Microsoft Excel, SAS, Stata, R, or SPSS for analysis." It doesn't answer your question about Stata's ability to operate via REDCap's application programming interface (presumably for pulling data), but at least REDCap can push data out in a form that Stata can read.

    Comment


    • #3
      REDCap is definitely not open source. Its API is web-based, and you cannot interact with it using Stata directly. You could do so via a Java plugin, but unless you had some compelling reason to do this, you would be better off writing a separate utility to interact with REDCap (e.g., in Python) and then passing the resulting data to/from Stata via a file-based interface. As Joseph noted, REDCap will export data in Stata format. I don't believe it will load data from a Stata file (though I don't know for sure), but you can certainly write Excel files from Stata that can then be uploaded to REDCap.

      Comment


      • #4
        I am aware of it can export the data in the form different statistical package, to be exactly precise whether state can use the API's to import export data without the person doing it manually. Secondly i am aware about the python plugins which is did right but main reason is our institution administrator does not grant permission for a third party plugin even for a specific project. Here is a code from SAS for interacting with REDcap API ( i was searching for something like this in STATA)
        Code:
        filename in  "C:\parameter.csv";
        filename out "C:\redcap_out.csv";
        
        %let token = 20000000000000020000020000000000002;
        %let url   = "https://redcap.institution.edu/api/"
        
        data _null_ ;
        file in ;
        put "%NRStr(content=record&type=flat&format=csv&token=)&token";
        run;
        
        proc http
           in=in
           out=out
           url=&url
           method="post";
        run;
        Thank you for the previous suggestions.
        Last edited by Nachiketh Soodana Prakash; 20 Oct 2014, 05:48.

        Comment


        • #5
          Unlike SAS, Stata is not able to generate arbitrary POST requests AFAIK. But you don't have to use SAS for this—you can use many other programming languages via either official or 3rd party libraries. The only one you can call directly from Stata, however, is Java (via a plugin).

          Comment


          • #6
            I have successfully integrated "wget" into Stata a few times. I use the "shell" command to invoke wget, then parse the output with Stata. Seems like this *might* get you where you need to be without invoking plug-ins or complex languages. The command SAS is running seems totally doable with wget.

            Comment

            Working...
            X