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]
Re: st: use of tempfile
From
Eric Booth <[email protected]>
To
[email protected]
Subject
Re: st: use of tempfile
Date
Thu, 19 Apr 2012 09:18:07 -0500
<>
On Apr 19, 2012, at 8:45 AM, Prakash Singh wrote:
>
> If you bye this it ok otherwise let me spend some time pondering about
> how best I can put my query to get solved
I think you were on the right track with showing the 'before' and 'after' data examples - but:
(1) you never explained how you get from the 'before' to the 'after' dataset or why you would want to do this (e.g., new variables appear out of nowhere in the 'after' dataset - where did they come from?; there is no indication of the decision rule you used to select observations in the dataset that would be merged back in , nor how/why you would merge back in some observations in your dataset and not others, nor what variable you used to perform the merge; there is no logic or decision rule given for how you renamed those variables in the 'after' dataset; there are apparently missing & crucial variables (e.g., common_id, sate_code) that might tell us how you are restructuring your data if they were included and properly explained, how item_code relates to state_code_*, and so on…).
(2) The code snippet you shared has more new variables(what is 'common_id'?), different variable names (and different spellings), you use the file extension ".data" instead of ".dta", and mystery datasets that get merged in (e.g., you first create sales1_1 and sales1_20 and then merge sales1_1 to mystery dataset sales1_2 (which contains what exactly?) and then you merge mystery dataset sales1_1_19 (again ?) to sales1_20 -- how could we know what these other datasets contain or why you are using this merge process?). This code only made all this less clear.
The only way you could get better input on this is to provide clearer explanations and a clearer 'before' and 'after' example - we cannot guess at all the things I've described above and give you useful advice.
If you explain how you get (or want to get) from the 'before' to the 'after' data step-by-step _and_ the rationale for doing so, I think you might get some good advice here.
- Eric
__
Eric A. Booth
Public Policy Research Institute
Texas A&M University
[email protected]
+979.845.6754
*
* 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/