Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: help merge

From   Oscar Alberto Budar Mejía <>
To   <>
Subject   st: RE: help merge
Date   Mon, 8 Sep 2003 16:38:01 -0500

I would do this:

open master.dta
	.use master.dta, clear

keep variables you want to paste to analytic.dta
	.keep var1 var2 var3...varN

sort the variables you are using to do the merge
	.sort varA varB varC
save master with another name
	.save master2.dta 

open analytic.dta, sort the variables you are using for the merge and
merge it with master2.dta
	.use analytic.dta, clear
	.sort varA varB varC
	.merge varA varB varC using master2.dta

Hope this will help you

Oscar Budar-Mejía
Dirección de Estudios Económicos
Banco de México
Av. Cinco de Mayo No. 18, 3º  Piso
Col. Centro
México D.F. 06059
Tel. 5237 2000, ext. 3583

-----Mensaje original-----
[] En nombre de Ritesh Mistry
Enviado el: Lunes, 08 de Septiembre de 2003 04:24 PM
Asunto: st: help merge

i have a simple problem about merging datasets.

i would like to add variables to analytic.dta from master.dta.

analytic.dta contains a subset of variables from master.dta. both
have the same observations.  how do i add a specific set of variables
master.dta to analytic.dta? i don't want to merge all the data, only

i'd appreciate any help. thanks!


*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index