Thank you. As you can tell, I'm a novice in Stata.
Does "merge" work if the variables have the same name in the two data sets?
Thank you again.
Alex
On 3/15/07, Jason Yackee <jyackee@law.usc.edu> wrote:

-merge- the two datasets.
-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Alex Koltai5
Sent: Thursday, March 15, 2007 5:20 PM
To: statalist@hsphsun2.harvard.edu
Subject: st: Simple Data Question
Sorry for a such a trivial question but I'm desperate.
I want to correlate two variables which are stored in different
data files (dat) in Stata.
Eg. Data1.dat contains variable P1, Data2.dat contains the
variable P2.
How in the world do I do this in Stata?
When I load one variable with "use 'Data1.dat'" and then save the
variable that I'm interested in with "gen xy=p1", then if I load the
other file the variable I saved (xy) gets deleted.
This is annoying as hell. I hope a kind soul will help me with
this trivial (but important to me) question.
Alex
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/