Announcement

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

  • Analysis of 'runs' in the data

    The data consists of a set of binary responses to a set of questions, although the questions are about different items they do follow a logical sequence from q4 to q21, and we have presented the results as the number of 0/1. A referee has made the following comment 'As well as presenting summary data the authors must respect the fact that there may be runs or sequences of responses and analyse the data appropriately. As they are using Stata this analysis of runs is trivial'.

    I have no idea what the referee means and have contacted the Journal for further clarification.

    I would be grateful if somebody could give me an idea of what sort of analysis, trivial or not, would be appropriate.

    This is a data sample:
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input int index byte(q4 q5 q6 q7 q8 q9 q10 q11 q12 q13 q14 q15 q16 q17 q18 q19 q20 q21)
     1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
     2 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
     3 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
     4 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
     5 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
     6 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
     7 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
     8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
     9 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
    10 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
    11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    12 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
    13 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
    14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    16 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
    17 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
    18 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
    19 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
    20 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
    end
    label values q4 yn
    label values q5 yn
    label values q6 yn
    label values q7 yn
    label values q8 yn
    label values q9 yn
    label values q10 yn
    label values q11 yn
    label values q12 yn
    label values q13 yn
    label values q14 yn
    label values q15 yn
    label values q16 yn
    label values q17 yn
    label values q18 yn
    label values q19 yn
    label values q20 yn
    label values q21 yn
    label def yn 0 "No", modify
    label def yn 1 "Yes", modify
    ------------------ copy up to and including the previous line ------------------

    Listed 20 out of 100 observations



    Thank you.
    Eddy


  • #2
    I also find the reviewer comment unclear; but there are at least 2 commands that may help you get a handle on what is going on: (1) runtest (part of official Stata) and (2) user-written tsspell;

    added: you can use the search command to find and install tsspell

    Comment


    • #3
      My guess is that patterns are meant that might turn up more often. For example, something like:
      11111111...
      00000000...
      010101010...

      You can test this as follows:

      Code:
      egen pattern = group(q4-q21)
      bysort pattern: egen n = count(_n)
      egen tagger = tag(pattern)
      keep if tagger == 1
      gsort -n
      list n q4-q21
      Best wishes

      Stata 18.0 MP | ORCID | Google Scholar

      Comment


      • #4
        Eddy:
        my feeling is that the reviewer (whose comment is unclear and I am surprised that the Editor did not ask him to clarify) may want to know the most frequent pattern (Rich and Felix may share my same impression).
        That said, you may want to consider:
        Code:
        . egen wanted=rowmean( q4- q21)
        
        . egen summary=group( wanted)
        
        . tab summary
        
        group(wante |
                 d) |      Freq.     Percent        Cum.
        ------------+-----------------------------------
                  1 |          4       20.00       20.00
                  2 |          7       35.00       55.00
                  3 |          9       45.00      100.00
        ------------+-----------------------------------
              Total |         20      100.00
        
        .
        As an aside, youm may want to -label- the different levels of -group- (#Yes;#No) to make them more readable.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Thank you all very much, you have given me some useful ideas to start with.

          I am also pleased that I am not the only one who did not understand the referee's comments—who referees the referees?

          Eddy

          Comment


          • #6
            ...who referees the referees?
            Theoretically, the editor or assistant editor handling your manuscript does, or if unsure, the entire editorial board of the journal. But it often appears that editors are loathe to challenge reviewers. The reviewer, after all, is selected because of his or her ostensible expertise in the area, whereas the members of the editorial board may or may not have expertise in the particular area of your article. Consider, however, that reviewing for academic journals is an unrewarded activity, and editors are constantly scrambling to find appropriate people and cajole them into service, so the level of expertise isn't necessarily what it should be.

            All of that said, when a reviewer's comments are unclear, you are always within your rights to correspond with the editor requesting clarification.

            Comment


            • #7
              I second @Rich Goldstein's suggestion to look at tsspell from SSC (full disclosure: it's mine) but its use would depend on a prior reshape long. Note also

              SJ-7-2 dm0029 . . . . . . . . . . . . . . Speaking Stata: Identifying spells
              . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . N. J. Cox
              Q2/07 SJ 7(2):249--265 (no commands)
              shows how to handle spells with complete control over
              spell specification

              which discusses some principles and Stata trickery. The original intention in writing that paper was to cover tsspell too, but the paper was long enough without it and the later idea that covering tsspell might need a sequel hasn't come to pass: the help file is fairly detailed and seems to serve well enough.

              As a twist on @Felix Bittmann's suggestion I wonder whether using egen's concat() function would be here more direct than egen's group() function.

              Comment

              Working...
              X