Announcement

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

  • Combining data across observations

    I have some duplicate observations, but they don't show up as such using duplicate report as there are differences in missing values across the variables as shown below:
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float(criteriaHRMIP DBSbirth_result DBSbirth_date dob_DBSbirth_date DBS6weeks_result DBS6weeks_date dob_DBS6weeks_date DBS6months_result DBS6months_date dob_DBS6months_date DBS9months_result DBS9months_date)
    . 1 21480 9999 1 21545 -9999 . 21679 -9999 . .
    3 1 21480 9999 1 21545 -9999 . 21679 -9999 . .
    end
    format %td DBSbirth_date
    format %td DBS6weeks_date
    format %td DBS6months_date
    format %td DBS9months_date
    label values criteriaHRMIP criteria
    label def criteria 3 "C", modify
    label values DBSbirth_result results
    label values DBS6weeks_result results
    label values DBS6months_result results
    label values DBS9months_result results
    label def results 1 "Negative", modify
    label def results 2 "No results", modify
    label values dob_DBSbirth_date ontime
    label values dob_DBS6weeks_date ontime
    label values dob_DBS6months_date ontime
    label def ontime 9999 "On time", modify
    label def ontime -9999 "Not on time", modify
    How can I combine the data across observations, so each person only has one observation?

  • #2
    duplicates report would not report these observations as duplicates because they differ on
    criteriaHRMIP -- so the question in turn is what you think should be done about missing values. See the concurrent thread https://www.statalist.org/forums/for...oup-identifier for one possibility.

    Comment

    Working...
    X