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: Keep data according to one data file's varlist,


From   daniel klein <klein.daniel.81@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Keep data according to one data file's varlist,
Date   Thu, 8 Nov 2012 13:13:24 +0100

Obviously, you cannot load all variables in either dataset (assuming
data1 is the larger and the error occurs when loading data2).

If you are using Stata SE (you do not tell us) -set maxvar- to 32000
and try again (see -help memory-). As outlines in a recent thread
(http://www.stata.com/statalist/archive/2012-11/msg00224.html) there
is no need to load the first dataset to get a list of its variables.
You can do something like

d using data2 ,varl
u `r(varlist)' using data1

If, unfortunatly, you only have access to Stata IC, there is not
really much you can do. In that case you will need to further cut down
on the number of variables you want to load.

Best
Daniel
-- 
Dear Sarah,

I tried your code
Use data2, clear
Ds
Use data1,
Keep 'r(varlist)'

I got the error message "no room to add more variables", do u have any
suggestions about this?
Thanks
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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