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: svy bootstrap
From
"Michael Palmer" <[email protected]>
To
<[email protected]>
Subject
RE: st: svy bootstrap
Date
Thu, 10 Mar 2011 14:44:05 +1100
I'm not sure that I follow you. Where in the program should I supply the
weights [pweight=psindwt]? Should I use the svyset command:
Svyset [pweight=psindwt]? Thank you!
Michael Palmer
PhD Candidate
National Centre for Epidemiology and Population Health
The Australian National University
Ph. 6125 0538
M. 0437 867 940
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Stas
Kolenikov
Sent: Thursday, 10 March 2011 2:23 PM
To: [email protected]
Subject: Re: st: svy bootstrap
Your -twopart- program expected weights, but you did not supply any when
you called it for the first time without any arguments. A more
protective code would have something like
if "`weight'" == "" {
display as error "twopart was expecting [pweight=variable], but none
was specified"
exit 198
}
to make sure all the required inputs were provided by the user (or by
the -bootstrap-).
On Wed, Mar 9, 2011 at 9:13 PM, Michael Palmer
<[email protected]> wrote:
> Thanks so much for your reply. I went ahead with the suggested code in
the single program.
> However, I was met with the error message: '=unknown weight type'.
>
> The revised do file is:
>
> capture program drop twopart
> program twopart, rclass
> syntax [pweight /]
> logit inpat_public $xlist1 if age > 5 [`weight'=`exp'] predict `pr_y',
> pr reg ipexp_public_log $xlist1 if age > 5 & inpat_public==1
> [`weight'=`exp'] predict `yhat', xb predict `ehat', residuals
etc.
> return scalar bpwd = `m_1'*`m_3' - `m_2'*`m_4'
>
> end
>
> set more off
> twopart
> return list
> bsweights bsw, reps(100) n(-1)
> bs4rw (bpwd=r(pwd)), rw(bsw*): twopart [pw=psindwt]
>
--
Stas Kolenikov, also found at http://stas.kolenikov.name Small print: I
use this email account for mailing lists only.
*
* 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/
*
* 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/