Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: bootstrap error: insufficient observations ...


From   Guido Heineck <guido.heineck@gmx.net>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: bootstrap error: insufficient observations ...
Date   Sun, 07 Oct 2007 19:29:05 +0200

Dear Maarten,

sorry for the late reply, but as ever thank you for your insights. I am however somewhat puzzled that the code I provided first used to work in Stata 9 (earlier this year), but not anymore in Stata 10.

Thanks again,
Guido


------------------------------

Date: Mon, 1 Oct 2007 10:44:50 +0100 (BST)
From: Maarten buis <maartenbuis@yahoo.co.uk>
Subject: Re: st: bootstrap error: insufficient observations ...

- --- Guido Heineck <guido.heineck@gmx.net> wrote:
I run a multinomial logit model and want to examine differences in predicted probabilities for different hypothetical groups of my
sample. Using the auto-data, the following code shows what I do.
<snip>

I tried several things, but so far I was not successful. I would thus
appreciate any helpful hint.
Try the following example:

*------------ example -------------------------
set more off

sysuse auto, clear
xtile lhs = price, nq(4)
gen forXmpg = foreign * mpg

capture program drop bst
program bst, rclass
	mlogit lhs foreign mpg forXmpg
	preserve
	drop _all
	set obs 4
	gen foreign = _n <= 2
	gen mpg = cond(mod(_n,2),11,22)
	gen forXmpg = foreign * mpg
	predict pr*, pr
	return scalar diff11 = pr1[1]-pr1[3]
	return scalar diff13 = pr3[1]-pr3[3]
	return scalar diff21 = pr1[2]-pr1[4]
	return scalar diff23 = pr3[2]-pr3[4]
	restore
end	

tempfile res
bootstrap diff11=r(diff11) diff13=r(diff13)  /*
       */ diff21=r(diff21) diff23=r(diff23), /*
       */ reps(100) saving(`res') seed(999): bst
use `res', replace
*------------ end example -------------------------
(For more on how to use examples I sent to the Statalist, see
http://home.fsw.vu.nl/m.buis/stata/exampleFAQ.html )

Hope this helps,
Maarten

- -----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
- -----------------------------------------
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index