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]

Re: st: Need Help with Stata Programming


From   William Buchanan <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Need Help with Stata Programming
Date   Tue, 4 Jun 2013 19:23:40 -0700

No offense, but it is starting to sound more like you're trying to find people to do work for you rather than find help solving some unique problem.  There are several websites containing Stata tutorials and also a book on data management and workflow design from StataPress.  Additionally, if you've read through some of the help files for the commands you are working with you would likely find substantive guidance that could help you solve your problem.  The other option is to hire a consultant to program what you need and work through teaching you how the code works to solve that specific problem (even though it might cost a little you kill two birds with one stone this way).  

What have you tried thus far that has failed to yield the results you are looking for?  Can you replicate the problems with other datasets so other people can work through your exact problem?  The Statalist FAQ has a lot of good information that could help you construct a question that would get the answer you are looking for while also ensuring other people with the same problem in the future could find an answer quickly/easily by searching through the Statalist archives.

HTH,
Billy

Sent from my iPhone

On Jun 4, 2013, at 19:02, Michael Stewart <[email protected]> wrote:

> Dear Statalist user ,
> 
> I need help with stat porgramming.
> 
> I am working with multiple datasets and with the  help of statalist
> users, was able to figure out a way to use multiple datasets, complete
> data management tasks and save them under separate files
> 
> MY DATA STRUCTURE:
> ***************************************************************
> auto-1 contains variables DX1-DX15;  variables DXCCS1-DXCCS-15 + other variables
> auto-2 contains variables DX1-DX25 ;  variables DXCCS1-DXCCS-25  +
> other variables
> auto-3 contains variables DX1-DX35 ;  variables DXCCS1-DXCCS-35  +
> other variables
> ****************************************************************
> 
> 
> My current code is as follows
> ***********************************************
> local ds1 "D:\_Dummy\multiple\1\auto_1.dta"
> local ds2 "D:\_Dummy\multiple\2\auto_2.dta"
> local ds3 "D:\_Dummy\multiple\3\auto_3.dta"
> local all ds1 ds2 ds3
> foreach x in `all'{
> use ``x'',clear
> gen x=0 if mpg>25
> gen y=2 if headroom<5
> save ``x''_new.dta,replace
> }
> ***********************************************
> 
> New Problem:1:
> The files are being saved under the same folder  as the auto-1,auto-2
> files.If I need to store the foled with path C:\research\auto; how can
> I accomplish it (I do not know as the filepath seems to be fixed in
> the ``x'' macro )
> 
> NEW PROBLEM-2:
> I need to append file-1 to auto-1 after approproate datamanagement in
> the  loop; append file-2 to auto-2 after approproate datamanagement in
> the  loop; append file-3 to auto-3 after approproate datamanagement in
> the  loop. How can I do it
> 
> New Problem-3:
> I need to merge  file-A to auto-1 after approproate datamanagement in
> the  loop; merge  file-B to auto-2 after approproate datamanagement in
> the  loop; merge  file-B to auto-3 after approproate datamanagement in
> the  loop. How can I do it
> 
> Please help me
> 
> --
> Thank you ,
> Yours Sincerely,
> Mike.
> *
> *   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/

*
*   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