Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: RE: RE: Possible bug


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: RE: Possible bug
Date   Sat, 7 Nov 2009 15:19:08 +0100

<>

So here is an illustration of the -drop- behavior of -rreg-: I increase the
outlier quality of observation # 23 in  the auto dataset, first by
multiplying it by 1.5. In this case, as the -summarize- command shows, its
cooks D stays below 1, so -rreg- uses all observations. 
In the last example, I increase the multiplier to 1.6, cooks D exceeds 1,
and number 23 now goes unused in -rreg-, as the last -list- command shows.
You may want to check this for your dataset...

*******
sysuse auto, clear

//normal case: no drop in -rreg-
qui{
	reg mpg weight foreign
	predict cooksdist, cooksd
	su cooksdist, det
}

qreg mpg weight foreign, nolog
rreg mpg weight foreign, nolog

//multiply one obs by 1.5
//no drop in -rreg- yet as max(cooks D)
//still below 1
replace weight=1.5*weight in 23

qui{
	reg mpg weight foreign
	capt drop cooksdist
	predict cooksdist, cooksd
	noi su cooksdist, det
}

qreg mpg weight foreign, nolog
rreg mpg weight foreign, nolog

//reload autos to start anew
sysuse auto, clear

//multiply one obs by 1.6
//now drop in -rreg- yet as max(cooks D)
//exceeds 1
replace weight=1.6*weight in 23

qui{
	reg mpg weight foreign
	capt drop cooksdist
	predict cooksdist, cooksd
	noi su cooksdist, det
}

qreg mpg weight foreign, nolog
rreg mpg weight foreign, nolog

//see unused obs (23)
l if !e(sample)
*******


HTH
Martin


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Apostolos Ballas
Sent: Samstag, 7. November 2009 13:57
To: [email protected]
Subject: st: RE: RE: Possible bug

Thanks for the suggestion. You are quite right - I cannot reproduce it. The
observation that is being dropped has the max value in one of the
independent variables. Is there an explanation for this?

Apostolos 

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Martin Weiss
Sent: Saturday, November 07, 2009 2:36 PM
To: [email protected]
Subject: st: RE: Possible bug


<>

Can you reproduce this with a built-in dataset? I cannot:

*******
sysuse auto, clear
rreg mpg weight foreign, nolog
qreg mpg weight foreign, nolog
rreg mpg weight foreign length turn, nolog qreg mpg weight foreign length
turn, nolog
*******

Also capture the one observation that -rreg- omits via -l if !e(sample)-
after estimation of -rreg-, and see what is special about it...


HTH
Martin


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Apostolos Ballas
Sent: Samstag, 7. November 2009 08:40
To: [email protected]
Subject: st: Possible bug

I am running a regression model using both quantile regression and robust
regression. In my output, robust regression reports 1 less observation than
quantile regression (which reports the right number of observations in my
sample). Is this is a feature of robust regression, am I missing something,
or is it a bug?

Thanks for your assistance,

Apostolos Ballas

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

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



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index