Announcement

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

  • #16
    I do stress in #14 that separation is needed. Frankly, I drew the line at working out which variable names belong where.

    Comment


    • #17
      Thanks to both of you for your valuable responses,
      Nick Cox Clyde Schechter
      Both the looping (for the total count) and the reshaping (for the individual count) were incredibly useful tools for resolving this in Stata.

      With your input, I was able to manage it successfully.
      Bellow is the new data, in case you're wondering what it looks like:



      Code:
      * Example generated by -dataex-. For more info, type help dataex
      clear
      input str21 Cultivo1M1 str8 Cultivo1M2 byte OrigenCultivo1 str21 Cultivo2M1 str8 Cultivo2M2 byte OrigenCultivo2 str33 Cultivo3M1 str29 Cultivo3M2 byte OrigenCultivo3 str21 Cultivo4M1 byte(Cultivo4M2 OrigenCultivo4 centralSAureus PerifSAureus TakenPerf)
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "NEGATIVO"              "." 1 ""                      ""  . ""                      . . 0 1 2
      "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" ""  0 ""                      "." . ""                      . . 1 1 1
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" ""  1 ""                      ""  . ""                      "." . ""                      . . 0 1 1
      "STAPHYLOCOCCUS AUREUS" "." 1 ""                      "." . ""                      ""  . ""                      . . 0 1 1
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" ""  1 ""                      . . 0 3 3
      "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" ""  1 ""                      "." . ""                      . . 0 2 2
      "NEGATIVO"              ""  1 "STAPHYLOCOCCUS AUREUS" ""  1 ""                      "." . ""                      . . 0 1 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "NEGATIVO"              "." 1 ""                      ""  . ""                      . . 0 1 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" ""  0 "STAPHYLOCOCCUS AUREUS" ""  1 ""                      "." . ""                      . . 1 1 1
      "STAPHYLOCOCCUS AUREUS" ""  1 ""                      ""  . ""                      "." . ""                      . . 0 1 1
      "STAPHYLOCOCCUS AUREUS" ""  1 ""                      ""  . ""                      "." . ""                      . . 0 1 1
      "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" ""  1 ""                      "." . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" ""  1 "NEGATIVO"              ""  1 ""                      "." . ""                      . . 0 1 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" ""  1 ""                      "." . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "NEGATIVO"              "." 1 ""                      ""  . ""                      . . 0 1 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" ""  1 ""                      "." . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" ""  0 "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      . . 1 2 2
      "STAPHYLOCOCCUS AUREUS" ""  1 "NEGATIVO"              ""  1 ""                      "." . ""                      . . 0 1 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" ""  1 "NEGATIVO"              ""  1 ""                      "." . ""                      . . 0 1 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" ""  1 ""                      "." . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "NEGATIVO"              "." 1 ""                      ""  . ""                      . . 0 1 2
      "NEGATIVO"              ""  1 "STAPHYLOCOCCUS AUREUS" ""  1 ""                      "." . ""                      . . 0 1 2
      "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" ""  1 ""                      "." . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" ""  1 ""                      "." . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" ""  1 ""                      ""  . ""                      "." . ""                      . . 0 1 1
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "NEGATIVO"              "." 1 ""                      ""  . ""                      . . 0 1 2
      "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" ""  1 ""                      "." . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" "." 0 ""                      . . 1 2 2
      "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" ""  1 ""                      "." . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" ""  1 ""                      "." . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" ""  1 ""                      "." . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "NEGATIVO"              "." 1 ""                      ""  . ""                      . . 0 1 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" ""  0 ""                      . . 1 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" ""  1 ""                      ""  . ""                      "." . ""                      . . 0 1 1
      "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" ""  1 ""                      "." . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" ""  1 ""                      "." . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" ""  1 ""                      . . 0 3 3
      "STAPHYLOCOCCUS AUREUS" "." 1 "NEGATIVO"              "." 1 ""                      ""  . ""                      . . 0 1 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" ""  1 "NEGATIVO"              ""  1 ""                      "." . ""                      . . 0 1 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" ""  1 ""                      "." . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 0 ""                      ""  . ""                      . . 1 1 1
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "NEGATIVO"              "." 1 "NEGATIVO"              ""  1 ""                      . . 0 1 3
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" ""  0 ""                      . . 1 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" ""  1 ""                      "." . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" "." 0 "STAPHYLOCOCCUS AUREUS" . 0 2 2 2
      "NEGATIVO"              ""  1 "STAPHYLOCOCCUS AUREUS" ""  1 ""                      "." . ""                      . . 0 1 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" ""  1 ""                      ""  . ""                      "." . ""                      . . 0 1 1
      "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" "." 0 ""                      . . 1 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "STAPHYLOCOCCUS AUREUS" "." 1 ""                      ""  . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" ""  1 "STAPHYLOCOCCUS AUREUS" ""  1 ""                      "." . ""                      . . 0 2 2
      "STAPHYLOCOCCUS AUREUS" "." 1 "NEGATIVO"              "." 1 ""                      ""  . ""                      . . 0 1 2
      end
      label values Cultivo1M1 CultureSet1Sample1
      label values Cultivo1M2 CultureSet1Sample2
      label values OrigenCultivo1 OrigenCulture
      label values OrigenCultivo2 OrigenCulture
      label values OrigenCultivo3 OrigenCulture
      label values OrigenCultivo4 OrigenCulture
      label def OrigenCultivo 0 "Catheter", modify
      label def OrigenCultivo 1 "Periferic", modify










      Comment

      Working...
      X