Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: sample partition issue & programming


From   Yang Li <Yang.Li-4@uts.edu.au>
To   statalist@hsphsun2.harvard.edu
Subject   st: sample partition issue & programming
Date   Thu, 01 Jul 2004 02:29:11 +1000

Dear statalists,

I am required to randomly partition my sample into two groups with 80% and 20% split, and run the normal OLS regression on the 80% set (report R square, Parameters, significance indicators, MSE/(var expected)). Then for each of the observation in my 20% set, I need to use the parameters calculated (from the 80% set) to produce and report the estimation error (for the dependent variable). This process is required to run 100 times.

I encountered the following difficulties:
1. how to keep both (80% and 20%) partitioned sample for further estimation (I can only find the command "sample", but it drops the observations and does not allow to maintain the rest 20% for further test).
2. how to output the specific estimation results (e.g. R square of 'reg') into a spreadsheet (e.g. Excel) (I can assess the estimated results stored in e( ), but how can I output it automatically to a Excel for report purpose).
3. how to do it automatically 100 times (How could I store the each partitioned sample (for 100 times) separately? Is a do-file enough to handle this?)

Best Regards,
Yang Li

School of Accounting
University of Technology, Sydney

UTS +61 2 95143684, fax +61 2 95143669

The information contained in this e-mail is confidential. It is intended soly for the addressee. If you receive this e-mail by mistake please promptly inform us by reply e-mail and then delete the e-mail and destroy any printed copy. You must not disclose or use in any way the information in the e-mail. There is no warranty that this email is error or virus free. If it is a private communication, care should be taken in opening it to ensure that undue offence is not given.


--
UTS CRICOS Provider Code: 00099F
DISCLAIMER: This email message and any accompanying attachments may contain
confidential information. If you are not the intended recipient, do not
read, use, disseminate, distribute or copy this message or attachments. If
you have received this message in error, please notify the sender immediately
and delete this message. Any views expressed in this message are those of the
individual sender, except where the sender expressly, and with authority,
states them to be the views the University of Technology Sydney. Before
opening any attachments, please check them for viruses and defects.
*
* 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/




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