Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Saving variable response sets over many datasets


From   Alex Sutherland <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Saving variable response sets over many datasets
Date   Mon, 4 Nov 2013 22:04:37 +0000

Dear Statalisters,

I am working with 97 datasets which *should* be the same but are not. =
The variables are named consistently but the response set for the =
variables differs. I would like to check the consistency of the =
responses by compiling the response sets for every variable & dataset in =
the order that the variables appear. I had thought something to the =
effect of:

foreach d of dataset {
	foreach var of varlist x1 x2 x3 {
		codebook `var'
		logout, excel `var'
		}
	}

Would work but codebook will not store the variable labels. So I'm =
unsure what is more suitable (-ds-?). Further, I'm again not sure how to =
append/add the output into a single (Excel) file.=20

Any suggestions / shortcuts are very welcome.

--------------------------------------------
Dr. Alex Sutherland
Social Sciences' Research Methods Centre / Institute of Criminology, 
University of Cambridge
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index