Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: OLS assumptions not met: transformation, gls, or glm as solutions?


From   Ryan Kessler <ryan.kessler.stata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: OLS assumptions not met: transformation, gls, or glm as solutions?
Date   Mon, 17 Dec 2012 10:41:35 -0500

The User's Guide is a great place to start. Maarten's point can also
be illustrated via simulation:

capture program drop ols_sim
program define ols_sim, rclass
	version 12
	syntax [, NONCONstant robust]
	set obs 300
	tempvar y x
	gen `x'=1 in 1/100
	replace `x'=2 in 101/200
	replace `x'=3 in 201/300
	
	if "`nonconstant'"!="" gen `y'=rnormal(`x',`x'^2) in 1/300
	else gen `y'=rnormal(`x',1) in 1/300

	reg `y' `x', `robust'
	return scalar beta1=_b[`x']
	test `x'=1
	return scalar pv=r(p)
end

clear
local reps=1000
cii `reps' `reps'*0.05
local v_lb=round(r(lb), 0.001)
local v_ub=round(r(ub), 0.001)

simulate beta=r(beta1) pv=r(pv), reps(`reps'): ols_sim, nonconstant robust
qui count if pv <= 0.05
local rej_rate=`=r(N)'/`reps'
di "Rejection rate =`rej_rate'     [`v_lb',`v_ub']"

Hope this helps!

Ryan

On Mon, Dec 17, 2012 at 10:27 AM, Maarten Buis <maartenlbuis@gmail.com> wrote:
> On Mon, Dec 17, 2012 at 4:17 PM, Carlo Lazzaro wrote:
>> The main meaning of my example is that you cannot be sure, after invoking
>> -robust-, that heteroskedasticity is automatically  removed. In other words,
>> homoskedasticity should be checked graphically even after - robust -.
>
> Robust standard errors do not change the coefficients, just the
> standard errors change. So the predicted values and residuals will
> also remain unchanged after you have specified the -vce(robust)-
> option. The whole point of robust standard errors is not that it
> "solves" in some way for heteroskedasticity, it just makes that
> "assumption" irrelevant. For more, see section 20.20 of the User's
> Guide.
>
> Hope this helps,
> Maarten
>
> ---------------------------------
> Maarten L. Buis
> WZB
> Reichpietschufer 50
> 10785 Berlin
> Germany
>
> http://www.maartenbuis.nl
> ---------------------------------
> *
> *   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/
*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index