Statalist The Stata Listserver


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

st: RE: CQREG CLAD


From   "Scott Merryman" <[email protected]>
To   <[email protected]>
Subject   st: RE: CQREG CLAD
Date   Mon, 11 Sep 2006 15:48:15 -0500

Paul,

1. You probably need to increase quantile.

2. There is brief discussion of bias in [R] bootstrap, page 150.

You also might the following program useful; unlike -clad- or -cqreg- it
only bootstraps (as an option) the standard errors, not the model
coefficients.

Scott
 

program cqreg2 
	version 9.2
	syntax varlist(min=1) [if] [, Quantile(real 0.5)  ll(string)
ul(string) bs reps(integer  100) save(string) grqreg]

tempvar yhat 
tokenize `varlist'
local lhs "`1'"
mac shift
local rhs "`*'"
		
preserve
qui {
qreg `lhs' `rhs' `if', q(`quantile')
predict `yhat'
sum `hat'
tempvar tag
if "`ll'" != "" & "`ul'" == "" {
	while  r(min) < `ll' {
		keep if  `yhat' >= `ll'
		qui qreg `lhs' `rhs' `if', quantile(`quantile' )
		qui drop `yhat'  
		predict `yhat' if e(sample)
		qui sum `yhat' if e(sample)
	}
}
if "`ll'" == "" & "`ul'" != "" {
	while  r(max) > `ul' {
		keep if  `yhat' <= `ul'
		qui qreg `lhs' `rhs' `if', quantile(`quantile' )
		qui drop `yhat'  
		predict `yhat' if e(sample)
		qui sum `yhat' if e(sample)
	}
}
if "`ll'" != "" & "`ul'" != "" {
	while  r(max) > `ul' &    r(min) < `ll' {
		keep if  `yhat' <= `ul' &  `yhat' >= `ll'
		qui qreg `lhs' `rhs' `if', quantile(`quantile' )
		qui drop `yhat'  
		predict `yhat' if e(sample)
		qui sum `yhat' if e(sample)
	}
}
}
if "`bs'" == "bs" {
	bsqreg `lhs' `rhs' `if', quantile(`quantile' ) reps(`reps')
	}
else {
	qreg 
	}
if "`grqreg'" != "" {
	grqreg, ci
	}
if "`save'" != "" {
	disp ""
	save "`save'", replace
	}
end


> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Paul GERRANS
> Sent: Thursday, September 07, 2006 8:35 PM
> To: [email protected]
> Subject: st: CQREG CLAD
> 
> Hello,
> I am using Professor Ken Chay's censored regression programs (cqreg and
> scls) available from his website http://elsa.berkeley.edu/~kenchay/
> Two questions:
> - While I can run Tobit and SCLS and get estimates most samples where I
> run cqreg i get "No covergence" after some considerable time. I have
> approx 4800 left-censored observations (0), 11200 uncensored observations
> and 1870 right-censored (100)
> - When I do get output for the cqreg and scls estimators what is the
> interpretation of the Bias output? Do I add/subtract from the coefficient
> estimate?



*
*   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