[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 |
st: Bootstrapping and delta method |

Date |
Mon, 13 Apr 2009 14:49:32 +0200 |

bootstrap, reps (1000): nlcom [z_read]z_ses*[z_write]z_read

Best, J. ------------------ begin example ---------------------- use http://www.ats.ucla.edu/stat/stata/notes/hsb2, clear foreach var of varlist read ses write { sum `var' if !missing(read,ses,write) gen double z_`var' = (`var' - r(mean))/r(sd) } capture program drop indir program define indir, rclass tempname b reg z_read z_ses scalar `b' = _b[z_ses] reg z_write z_read z_ses return scalar indir = _b[z_read]*`b' end indir bootstrap indir=r(indir), reps(1000): indir estat bootstrap, bc p norm qui sureg (z_read z_ses) (z_write z_read z_ses) nlcom [z_read]z_ses*[z_write]z_read *--------------- end example --------------------------- ____________________________________________________ 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 ____________________________________________________ * * 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/

- Prev by Date:
**st: RE: Stata coding** - Next by Date:
**st: RE: Efficiently run three loops (or do without them)** - Previous by thread:
**st: Efficiently run three loops (or do without them)** - Next by thread:
**st: Error computing eigenvalues using mata** - Index(es):

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