| From | "Michael Blasnik" <michael.blasnik@verizon.net> |
| To | <statalist@hsphsun2.harvard.edu> |
| Subject | st: Re: sample partition issue & programming |
| Date | Wed, 30 Nov 2005 10:37:25 -0500 |
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
* * 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–2008 StataCorp LP | Terms of use | Privacy | Contact us | What's new | Site index |