Lee Sieswerda
>
> I agree with Nick C. I think your best bet is to generate a
> do-file from
> your error dataset. However, if like me you are "scripting
> language"-challenged, you can do it using Stata's -file-
> command. This
> little sequence seems to work:
>
> file open myfile using repl_errs.txt, write replace
> forvalues n = 1/(# of obs in error dataset) {
> local err_var = err_var[`n']
> local correct = correct[`n']
> local id = id[`n']
> file write myfile "replace `err_var' = `correct' in `id'" _n
> }
> file close myfile
>
Nice!
Or
gen str1 mydo = ""
replace mydo = "replace " + err_var + "=" + correct + " if id==" + id
outsheet mydo using mydo.do, nonames noquote
and after reading in original data
do mydo.do
which I should have thought of earlier...
Nick
[email protected]
*
* 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/