Announcement

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

  • importing pictures from kobo toolbox with stata

    I am working in a study where the data collection is done by Kobo Toolbox and I am importing all the data from the different questionnaires into Stata to do the analysis. The questionnaires include pictures (jpg) taken by the kobo collect. I would like to know if possible to open the picture from stata, as stata makes the link between the study_id and the number of the picture; otherwise if I open the picture file outside stata I need to look manually to which study id corresponds.

    Is it possible to open a picture from stata? Should I change the format of jpg in order to do that? As example I send when listing the variable of pics how it is shown in stata. Thanks Maria

    Click image for larger version

Name:	example2.png
Views:	1
Size:	76.6 KB
ID:	1533074


  • #2
    Stata does not seem to have any built-in viewer for pictures. With that said, it is possible to have Stata run an operating system command to open a picture in an external viewer. For example, in Stata on my Mac
    Code:
    shell open ~/Downloads/Tuscan-Landscape-900.jpg
    launches Preview and opens the jpg in that application.

    Comment


    • #3
      The -shellout- trick here might work?

      https://www.statalist.org/forums/for...in-stata-graph
      __________________________________________________ __
      Assistant Professor, Department of Biostatistics and Epidemiology
      School of Public Health and Health Sciences
      University of Massachusetts- Amherst

      Comment


      • #4
        An alternative could be to use SMCL directives to launch the shell command with a clickable link. This performs the same -shell- execution command as described by William in #2, but adds the link.

        Code:
        di `"{stata !"/path/to/file.ext"}"'
        Also, you could also use the SMCL browse directive to let your system decide how to open it (on Windows, this opens the file directly with it's associated viewer) but may also resort to a browser.

        Code:
        di `"{browse "/path/to/file.ext"}"'
        These two methods have been discussed here and here.

        Comment

        Working...
        X