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

Re: st: Programming stata using egen functions

From   Maarten buis <>
Subject   Re: st: Programming stata using egen functions
Date   Tue, 28 Apr 2009 16:45:00 +0000 (GMT)

--- Anne Resende wrote:
> 3)What is my aim? As I told I need to end up with one variable in
> order to run the bootstrap. 
> I want to the create the program mymean and then run: 
> bootstrap r(eq2), reps(#) seed(#)  : mymean loghw 

Why do you need to write a program for that? I can think of two 
ways of doing that that won't require you to write your own 

*-------------- begin example --------------------
sysuse nlsw88, clear
gen lnw = ln(wage)
bootstrap m=r(mean), reps(100) : sum lnw, meanonly
reg lnw, vce(bootstrap, reps(100))
*---------------- end example --------------------

Anyhow, if you want to write a program to pass on to -bootstrap-
then the results should definately not be returned as a variable.
So even if I misunderstood your aim, and you need to write a 
program, then an -egen- function would in all likelihood still be  
inappropriate for what you want to do.

If the example above does not do what you want to do, can you 
explain again what it is exactly that you want to do?

Hope this helps,

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen


*   For searches and help try:

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