[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
John Antonakis <john.antonakis@unil.ch> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: AW: Simulating stepwise regression |

Date |
Fri, 07 Aug 2009 12:18:23 +0200 |

That's very helpful; thanks Martin.

Best, J. ____________________________________________________ Prof. John Antonakis Associate Dean Faculty of Business and Economics University of Lausanne Internef #618 CH-1015 Lausanne-Dorigny Switzerland Tel ++41 (0)21 692-3438 Fax ++41 (0)21 692-3305 Faculty page: http://www.hec.unil.ch/people/jantonakis&cl=en Personal page: http://www.hec.unil.ch/jantonakis ____________________________________________________ On 07.08.2009 12:06, Martin Weiss wrote:

<>You could also -tokenize- the return from -indeplist- and have your -program- return the regressors one by one... ************* capt prog drop sim version 10.1 program define sim, rclass drop _all set obs 100 gen y = invnorm(uniform()) gen x1 = invnorm(uniform()) gen x2 = invnorm(uniform()) gen x3 = invnorm(uniform()) gen x4 = invnorm(uniform()) gen x5 = invnorm(uniform()) stepwise, pr(.2): regress y x1-x5 qui indeplist tokenize "`r(X)'" ret loc one="`1'" ret loc two="`2'" ret loc three="`3'" ret loc four="`4'" ret loc five="`5'" end sim ret li ************* HTH Martin -----Ursprüngliche Nachricht----- Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von John Antonakis Gesendet: Freitag, 7. August 2009 11:47 An: statalist@hsphsun2.harvard.edu Betreff: st: Simulating stepwise regression Hi:I would like to simulate the below. Note, I am no fan of stepwise--Ijust want to demonstrate it evilsHowever, I do not know1. what to put in the place of "??"--that is, I want the program tocapture only the variables that were selected in the model as beingsignificant2. how to simulate the r-square.3. how to extend the simulation (a new program) such that I simulatefrom n = 50 to n=1000 (in increments of 50), crossed with independentvariables ranging from x1 to x100.Regards, John. Here is the program: set seed 123456 capture program drop sim version 10.1 program define sim, eclass drop _all set obs 100 gen y = invnorm(uniform()) gen x1 = invnorm(uniform()) gen x2 = invnorm(uniform()) gen x3 = invnorm(uniform()) gen x4 = invnorm(uniform()) gen x5 = invnorm(uniform()) stepwise, pr(.2): regress y x1-x5 end simulate ??? , reps(20) seed (123) : sim, foreach v in ?? { gen t_`v' = /* */_b_`v'/_se_`v' gen p_`v' =/* */ 2*(1-normal(abs(t_`v'))) } ____________________________________________________ Prof. John Antonakis Associate Dean Faculty of Business and Economics University of Lausanne Internef #618 CH-1015 Lausanne-Dorigny Switzerland Tel ++41 (0)21 692-3438 Fax ++41 (0)21 692-3305 Faculty page: http://www.hec.unil.ch/people/jantonakis&cl=en Personal page: http://www.hec.unil.ch/jantonakis ____________________________________________________ * * 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/ * * 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/

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

**Follow-Ups**:**AW: st: AW: Simulating stepwise regression***From:*"Martin Weiss" <martin.weiss1@gmx.de>

**Re: st: AW: Simulating stepwise regression***From:*Tirthankar Chakravarty <tirthankar.chakravarty@gmail.com>

**References**:**Re: Re: st: Panel data regression***From:*Andreas Hatzigeorgiou <anha@umich.edu>

**st: Simulating stepwise regression***From:*John Antonakis <john.antonakis@unil.ch>

**st: AW: Simulating stepwise regression***From:*"Martin Weiss" <martin.weiss1@gmx.de>

- Prev by Date:
**st: AW: estout after margeff** - Next by Date:
**Re: st: estout after margeff** - Previous by thread:
**st: AW: Simulating stepwise regression** - Next by thread:
**Re: st: AW: Simulating stepwise regression** - Index(es):

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