La Hipotesis de Homocedasticidad

10

Click here to load reader

Transcript of La Hipotesis de Homocedasticidad

Page 1: La Hipotesis de Homocedasticidad

La hipótesis o supuesto de homocedasticidad, en el modelo de regresión lineal simple

La hipótesis de homocedasticidad implica que

2

iVar( ) Cons tan teε σ= =

La de homocedasticidad se detecta fácilmente en el gráfico de residuos (eij) frente a las predicciones ( i) o, equivalentemente, en el gráfico de los residuos (eij) frente a la variable regresora (xi).

Patrón residual indicativo de homocedasticidad

Predichos

Res

iduo

s

80 110 140 170 200 230-41

-21

-1

19

39

59

Lo ideal es que los residuos se sitúen en una banda horizontal

La forma de embudo para los residuos es una indicación de heterocedasticidad

Patrón residual indicativo de homocedasticidad

Predichos

Res

idu

os

95 95.2 95.4 95.6 95.8 96 96.2-130

-80

-30

20

70

120

170

Page 2: La Hipotesis de Homocedasticidad

Como determinar con el Statgraphics el cumplimiento de la hipótesis de homocedasticidad

Se introducen los datos

Se procesa

Se seleccionan las variables

Page 3: La Hipotesis de Homocedasticidad

Al dar ok obtenemos

Ahora se solicitan todos los gráficos al dar click en

Page 4: La Hipotesis de Homocedasticidad

Simple Regression - Ventas al por Menor _Y_ vs. Renta _X_ Regression Analysis - Linear model: Y = a + b*X ----------------------------------------------------------------------------- Dependent variable: Ventas al por Menor _Y_ Independent variable: Renta _X_ ----------------------------------------------------------------------------- Standard T Parameter Estimate Error Statistic P-Value ----------------------------------------------------------------------------- Intercept 1922.39 274.949 6.99181 0.0000 Slope 0.381517 0.0252931 15.0838 0.0000 ----------------------------------------------------------------------------- Analysis of Variance ----------------------------------------------------------------------------- Source Sum of Squares Df Mean Square F-Ratio P-Value ----------------------------------------------------------------------------- Model 4.96143E6 1 4.96143E6 227.52 0.0000 Residual 436127.0 20 21806.3 ----------------------------------------------------------------------------- Total (Corr.) 5.39756E6 21 Correlation Coefficient = 0.958749 R-squared = 91.9199 percent R-squared (adjusted for d.f.) = 91.5159 percent Standard Error of Est. = 147.67 Mean absolute error = 115.559 Durbin-Watson statistic = 1.47907 (P=0.0651) Lag 1 residual autocorrelation = 0.244342 The StatAdvisor --------------- The output shows the results of fitting a linear model to describe the relationship between Ventas al por Menor _Y_ and Renta _X_. The equation of the fitted model is Ventas al por Menor _Y_ = 1922.39 + 0.381517*Renta _X_ Since the P-value in the ANOVA table is less than 0.01, there is a statistically significant relationship between Ventas al por Menor _Y_ and Renta _X_ at the 99% confidence level. The R-Squared statistic indicates that the model as fitted explains 91.9199% of the variability in Ventas al por Menor _Y_. The correlation coefficient equals 0.958749, indicating a relatively strong relationship between the variables. The standard error of the estimate shows the standard deviation of the residuals to be 147.67. This value can be used to construct prediction limits for new observations by selecting the Forecasts option from the text menu. The mean absolute error (MAE) of 115.559 is the average value of

Page 5: La Hipotesis de Homocedasticidad

the residuals. The Durbin-Watson (DW) statistic tests the residuals to determine if there is any significant correlation based on the order in which they occur in your data file. Since the P-value is greater than 0.05, there is no indication of serial autocorrelation in the residuals.

Plot of Fitted Model

Renta _X_

Ven

tas

al p

or M

enor

_Y

_

9 10 11 12 13(X 1000)

5300

5600

5900

6200

6500

6800

7100

Plot of Ventas al por Menor _Y_

5300 5600 5900 6200 6500 6800 7100

predicted

5300

5600

5900

6200

6500

6800

7100

obse

rved

Page 6: La Hipotesis de Homocedasticidad

Residual Plot

9 10 11 12 13(X 1000)

Renta _X_

-2.6

-1.6

-0.6

0.4

1.4

2.4

3.4S

tude

ntiz

ed r

esid

ual

Residual Plot

5300 5600 5900 6200 6500 6800

predicted Ventas al por Menor _Y_

-2.6

-1.6

-0.6

0.4

1.4

2.4

3.4

Stu

dent

ized

res

idua

l

Page 7: La Hipotesis de Homocedasticidad

Residual Plot

0 4 8 12 16 20 24

row number

-2.6

-1.6

-0.6

0.4

1.4

2.4

3.4S

tude

ntiz

ed r

esid

ual

Guardamos los residuales

Y con ellos validamos los supuestos del modelo. Para el supuesto o hipótesis de homocedasticidad, se puede hacer gráficamente o además como el procedimiento de regresión lineal no nos da estadísticos para realizar una prueba formal, se puede agregar una nueva variable, puede ser grupos.

Page 8: La Hipotesis de Homocedasticidad

Y con esta nueva variable y residuals se corre el procedimiento para la Anova de una vía:

Page 9: La Hipotesis de Homocedasticidad

Se da click en opciones de tabulación

Ahora se obtiene:

Variance Check

Cochran's C test: 0.520069 P-Value = 0.34185

Bartlett's test: 1.14432 P-Value = 0.302857

Hartley's test: 3.47972

Levene's test: 2.02985 P-Value = 0.158872

Page 10: La Hipotesis de Homocedasticidad

The StatAdvisor

The four statistics displayed in this table test the null hypothesis that the standard deviations of RESIDUALS within each of the 3 levels of Grupos is the same. Of particular interest are the three P-values. Since the smallest of the P-values is greater than or equal to 0.05, there is not a statistically significant difference amongst the standard deviations at the 95.0% confidence level.

Para la hipótesis formal:

( )( )

2

0 i

1 i

H :Var cons tan te

H :Var no es cons tan te

ε σε

= =

=

Para un α =5%, las tres pruebas presentan p-valores mayores que α, por lo tanto se acepta la hipótesis nula.