Announcement

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

  • rowmiss


    Dear Stata user,
    I will create mean scores for a selection of variables, an I need to take into account missing values. The first command works fine, but for the second one “t1_miss_ boundaries” I got the following error message” too many variables specified r(103)”. I can’t understand this since there are the same amount of variables in “t1_miss_control” as in “t1_miss_ boundaries”.

    First command ( works fine)
    egen t1_miss_control=rowmiss (Q10a Q10b Q10c Q10d Q10e_r Q10f)
    egen t1_control=rowmean (Q10a Q10b Q10c Q10d Q10e_r Q10f)if t1_miss_control<4

    Second command ( error message “” too many variables specified r(103)”.)
    egen t1_miss_ boundaries=rowmiss (Q11a Q11b Q11c Q11d Q11e Q11f)
    egen t1_ boundaries=rowmean (Q11a Q11b Q11c Q11d Q11e Q11f)if t1_miss_ boundaries<4
    Can someone see what’s wrong in the second command?
    Many thanks

  • #2
    In practice spaces before the function name are indulged as is the lack of a space before an if qualifier. I can't see a problem that would be fatal.

    But occasionally strange characters can be problematic particularly if you copied and pasted from somewhere else in the first instance.

    Recently I copied and pasted code from one of my own documents and was frustrated at its not working until close scrutiny revealed en-dashes in Stata where minus signs were needed. Oddly enough in the original document minus signs were explicitly chosen....

    If I am right then naturally the error message is misleading. But as you say on the face of it the error message makes no sense.
    Last edited by Nick Cox; 11 Dec 2019, 07:10.

    Comment


    • #3
      Many thanks. I will look more into this.

      Comment

      Working...
      X