Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: -bootstrap- of decomposition by user-written -jmp2- package


From   Michael Buryak <[email protected]>
To   [email protected]
Subject   Re: st: RE: -bootstrap- of decomposition by user-written -jmp2- package
Date   Sat, 3 Dec 2005 15:17:08 +0200

Thanks Ben Jann for a help

It's work. I just add some matrixes in result table these interest me.
Syntax look like this:
***********************begin*******************************
use "x:\...\*.dta"
keep if ............... ///*keeping relevant variables*///

capture program drop bs_jmp2
program bs_jmp2, rclass
///standart jmp2 syntax

	reg ln_incms age age_sq if  year==1975 &  ethnicity==1
		estimates store ash_75
	reg ln_incms age age_sq if  year==1975 &  ethnicity==0
		estimates store miz_75
	reg ln_incms age age_sq if  year==1979 &  ethnicity==1
		estimates store ash_79
	reg ln_incms age age_sq if  year==1979 &  ethnicity==0
		estimates store miz_79
	jmp2 ash_75 miz_75 ash_79 miz_79 , benchmark(1) reference(1)

 // return results from jmp2 as scalars
	   ret scalar D = el(r(DD),1,1)
	   ret scalar E = el(r(E),1,1)
	   ret scalar EQ = el(r(E),1,2)
	   ret scalar EP = el(r(E),1,3)
	   ret scalar U = el(r(U),1,1)
	   ret scalar UQ = el(r(U),1,2)
	   ret scalar UP = el(r(U),1,3)

end

****************************************************************
preserve
	#delimit ;
		keep ln_incms year sex age age_sq;
	#delimit cr;
	set seed 10000
 bootstrap D=r(D) E=r(E) EQ=r(EQ) EP=r(EP) U=r(U) UQ=r(UQ) UP=r(UP) ,
nodrop reps(1000): bs_jmp2
restore
***********************end************************************





2005/12/2, Jann  Ben <[email protected]>:
> Michael Buryak asks how to bootstrap results from -jmp2-.
> This can be done, for example, as follows:
>
>   capture program drop bs_jmp2
>   program bs_jmp2, rclass
>   // Michals original commands
>     ...
>     jmp2 ...
>   // return results from jmp2 as scalars
>     ret scalar D = el(r(DD),1,1)
>     ret scalar E = el(r(DD),1,2)
>     ret scalar U = el(r(DD),1,3)
>     ...
>   end
>
>   set seed #
>   bootstrap D=r(D) E=r(E) U=r(U) ..., nodrop: jmp_bs
>
> The "nordop" option is important, because jmp2 is not an
> e-class program and does not set e(sample). To speed up the
> bootstrap procedure, Michael should drop unused cases before
> applying the bootstrap. For example:
>
>   preserve
>   keep if inlist(year,1975,1979) & inlist(ethnicity,0,1)
>   set seed #
>   bootstrap D=r(D) E=r(E) U=r(U) ..., nodrop: jmp_bs
>   restore
>
>
>   bootstrap D=r(D) E=r(E) U=r(U) ..., nodrop: jmp_bs
>
> > -----Original Message-----
> > From: [email protected]
> > [mailto:[email protected]] On Behalf Of
> > Michael Buryak
> > Sent: Friday, December 02, 2005 8:44 PM
> > To: [email protected]
> > Subject: st: -bootstrap- of decomposition by user-written
> > -jmp2- package
> >
> >
> > Hi!
> > Help me, please!
> >
> > I'm trying decomposition by -jmp2- package. Syntax looks like this:
> >
> > -------------------------------------start
> > example-------------------------------------------------------
> > -------------
> > reg ln_incms age age_sq marital educ if  year==1975 &  ethnicity==1
> > estimates store ashkenazi_75
> > reg ln_incms age age_sq marital educ if  year==1975 &  ethnicity==0
> > estimates store mizrahi_75
> > reg ln_incms age age_sq marital educ if  year==1979 &  ethnicity==1
> > estimates store ashkenazi_79
> > reg ln_incms age age_sq marital educ if  year==1979 &  ethnicity==0
> > estimates store mizrahi_79
> > jmp2 ashkenazi_75 mizrahi_75 ashkenazi_79 mizrahi_79 ,
> > benchmark(1) reference(1)
> > -------------------------------------end
> > example-------------------------------------------------------
> > ---------------
> >
> > I need to test significant of decomposition results by
> > -bootstrap- method.
> > Help me, please. What will I add to the syntax?
> > I really need your help
> >
> > Thank you in advance,
> > Michael Buryak <[email protected]>
> > Department of Labor Studies,
> > Tel-Aviv University, Israel
> >
> > *
> > *   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/
> >
>
> *
> *   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/
>

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index