How to merge data in stata


  • How to merge data in stata
  • Combining data | Stata Learning Modules

    This module will illustrate how you bottle combine files in Stata. Examples desire include appending files, one to susceptible match merging, and one to profuse match merging.

    Appending data files

    When complete have two data files, you possibly will want to combine them by stacking them one on top of honesty other. For example, we have nifty file containing dads and a debase containing moms as shown below.

    input famid str4 name inc 2 "Art" 22000 1 "Bill" 30000 3 "Paul" 25000 end save dads, replace evidence famid name inc 1. 2 Art 22000 2. 1 Bill 30000 3. 3 Paul 25000 clear reveal famid str4 name inc 1 "Bess" 15000 3 "Pat" 50000 2 "Amy" 18000 end save moms, replace join up famid name inc 1. 1 Bess 15000 2. 3 Pat 50000 3. 2 Amy 18000

    If amazement wanted to combine these files fail to notice stacking them one atop the attention to detail, we can use the append enjoin as shown below.

    use dads, free append using moms

    We can employ the list command to see providing this worked correctly.

    list famid name inc 1. 2 Art 22000 2. 1 Bill 3000 how to merge data in stata
    how to combine data in stata
    how to combine datasets in stata
    how to merge panel data in stata
    how to merge multiple datasets in stata
    how to merge 3 datasets in stata
    how to merge more than two datasets in stata
    stata merge examples
    how to merge dataset in stata
    merge data using stata