Announcement

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

  • Verifying observations in three different datasets

    Hello,

    I have three datasets which are structured identically and I would like to Identify the set of observations that appear in all three datasets, as well as the set of observations that appear in only 2 of the 3 datasets and the set of observations that appear in only 1 of the 3 datasets. Anyone have an idea of what's the best way to approach this problem.

    Thanks,
    Jad

  • #2
    Code:
    clear
    use dataset1
    gen byte in1 = 1
    merge 1:1 linkvar using dataset2, gen(merge12)
    gen byte in2 = inlist(merge12, 2, 3)
    merge 1:1 linkvar using dataset3, gen(merge123)
    gen byte in3 = inlist(merge123, 2, 3)
    mvencode *, mv(0) override
    egen n_files = rowtotal(in*)

    Comment


    • #3
      Thank you :D

      Comment

      Working...
      X