Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: bootstrapping different models using the same samples
From
Maarten Buis <[email protected]>
To
[email protected]
Subject
Re: st: bootstrapping different models using the same samples
Date
Tue, 28 Jun 2011 17:38:25 +0200
I would bundle both regressions and the computation of whatever
combination of parameters you like in one program and bootstrap that.
*--------------- begin example --------------------
sysuse auto, clear
replace price = price /1000
program drop _all
program toboot, rclass
tempname b
reg price mpg foreign
scalar `b' = _b[mpg]
reg rep78 mpg foreign
return scalar ratio = _b[mpg] / `b'
end
bootstrap ratio=r(ratio), reps(100) : toboot
*-------------------- end example ---------------------
(For more on examples I sent to the Statalist see:
http://www.maartenbuis.nl/example_faq )
Hope this helps,
Maarten
On Tue, Jun 28, 2011 at 5:05 PM, Steve Martin <[email protected]> wrote:
> I have a data set with 152 observations on y1 y2 x1 x2 x3 x4 x5.
>
> Will
>
> set seed 75
> bootstrap, reps(500): reg y1 x1 x2 x3
>
> use the same 500 data samples as
>
> set seed 75
> bootstrap, reps(500): reg y2 x1 x4 x5?
>
> [I want to compare the correlation between the coefficients on x2 and x4].
>
> Thanks.
>
> Steve
>
> *
> * 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/
>
--
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://www.maartenbuis.nl
--------------------------
*
* 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/