Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: merging two datasets of long format


From   "Raquel Guimaraes" <raquelrguimadem@gmail.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: merging two datasets of long format
Date   Fri, 20 Apr 2012 07:07:55 -0700

Thanks Eric!!! Sorry for the silly question!

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Eric Booth
Sent: Friday, April 20, 2012 5:53 AM
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: merging two datasets of long format

<>

Hi Raquel:

The issue is that this line:


> merge m:1 id2 id3 id4 "$directory\clean\teachers" 


should be:

merge m:1 id2 id3 id4  using "$directory\clean\teachers" 

When you leave out "using" it thinks the filepath is another variable in
your varlist.

- Eric

__
Eric A. Booth
Public Policy Research Institute 
Texas A&M University
ebooth@ppri.tamu.edu
+979.845.6754

On Apr 19, 2012, at 9:39 PM, Raquel Guimaraes wrote:

> Hi everyone,
> 
> I have two datasets in the long format:
> 
> Students -- identifiers: id1 (student-specific), id2, id3, id4
> Teachers -- identifiers: id2, id3, id4, id5(teacher-specific)
> 
> I want to merge students to teachers using id2, id3 and id4. The two
> datasets above are in long format, and "time" is the time variable.
> 
> When  I do the merge after sorting the variables:
> 
> use "$directory\clean\students", clear
> sort id2 id3 id4
> merge m:1 id2 id3 id4 "$directory\clean\teachers" 
> 
> I got the following error: "factor variables and time-series operators not
> allowed"
> 
> Any help will be appreciated!
> 
> Thanks,
> 
> Raquel

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index