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: Last estimates not found after bs4rw
From
Saidé Salazar <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: Last estimates not found after bs4rw
Date
Fri, 20 Sep 2013 18:04:46 -0500
Thank you Jeff for all your help and explanation. I am using Stata 13,
and as you correctly assumed, I need the -logit- results to do
something else. Actually, I want to perform the following steps:
1. Estimate logit
2. Estimate predicted probabilitites for out of sample observations
3. Obtain the mean of predicted probabilities
4. Repeat the process for each rweight.
So far, my do-file looks like this:
use myfile, clear
program define myprog
syntax [pw iw] [if] [in] , first(varlist numeric) second(string)
third(string)
preserve
logit `first' if sample=="`second'"
predict pre if sample=="`third'"
mean pre
restore
end
foreach y in y1 y2 y3{
bs4rw, rw(wt*): myprog [pw=wt], first(`y' x1 x2 x3) second(sampleA)
third(sampleB)
}
The result I obtain is the mean table, but with missing values in all
columns except -Estimated Coef.-. It looks like Stata is using the
same sample every time, not the rweights.
I have tried with -svy- prefix, but I get "las estimates not found".
Here is the do-file:
use myfile, clear
svyset idstd [pw=wt],vce(bootstrap) bsrweight(wt*)
program define myprog
syntax [pw iw] [if] [in] , first(varlist numeric) second(string)
third(string)
preserve
logit `first' if sample=="`second'"
predict pre if sample=="`third'"
mean pre
restore
end
foreach y in y1 y2 y3{
svy: myprog, first(`y' x1 x2 x3) second(sampleA) third(sampleB)
}
I would deeply thank any advice.
Regards,
Aranzazu
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/