Supuestos Del MCO: Teorema Del Limite Central
Supuestos Del MCO: Teorema Del Limite Central
Supuestos Del MCO: Teorema Del Limite Central
Sergio Diaz
2023-06-21
hist(log(df$l))
1
Histogram of log(df$l)
150
Frequency
100
50
0
2 3 4 5 6 7 8
log(df$l)
muestra <- 70
n_muestra <- 50
cont <- c()
for(i in 1:muestra){
mean <- mean(sample(log(df$k),n_muestra))
cont <- c(cont,mean)
}
hist(cont)
2
Histogram of cont
20
15
Frequency
10
5
0
cont
hist(df$l)
3
Histogram of df$l
800
600
Frequency
400
200
0
df$l
muestra <- 70
n_muestra <- 50
cont <- c()
for(i in 1:muestra){
mean <- mean(sample(df$k,n_muestra))
cont <- c(cont,mean)
}
hist(cont)
4
Histogram of cont
15
Frequency
10
5
0
cont
Supuestos de GaussMarko
Linealidad
Modelo no lineal
plot(df$k,modelo1$residuals)
5
60000
modelo1$residuals
20000
−20000
df$k
plot(df$l,modelo1$residuals)
6
60000
modelo1$residuals
20000
−20000
df$l
Modelo lineal
plot(log(df$l),modelo2$residuals)
7
2
modelo2$residuals
1
0
−1
−2
2 3 4 5 6 7 8
log(df$l)
plot(log(df$k),modelo2$residuals)
8
2
modelo2$residuals
1
0
−1
−2
2 3 4 5 6 7
log(df$k)
Homocedasticidad
Breusch-Pagan
# Cargar librerías
library(lmtest)
##
## Attaching package: ’zoo’
9
##
## studentized Breusch-Pagan test
##
## data: modelo1
## BP = 53.778, df = 2, p-value = 2.101e-12
Caso no heterocedastico
##
## studentized Breusch-Pagan test
##
## data: modelo2
## BP = 1.572, df = 2, p-value = 0.4557
Independencia
## l k r1
## l 1.000000e+00 4.663293e-03 1.332444e-17
## k 4.663293e-03 1.000000e+00 -6.958644e-17
## r1 1.332444e-17 -6.958644e-17 1.000000e+00
Normalidad
Caso no normal
hist(df$r1)
10
Histogram of df$r1
500
Frequency
300
100
0
df$r1
Caso normal
hist(df$r2)
11
Histogram of df$r2
250
200
Frequency
150
100
50
0
−2 −1 0 1 2 3
df$r2
Test de Shapiro-Wilk
shapiro.test(modelo1$residuals)
##
## Shapiro-Wilk normality test
##
## data: modelo1$residuals
## W = 0.62605, p-value < 2.2e-16
shapiro.test(modelo2$residuals)
##
## Shapiro-Wilk normality test
##
## data: modelo2$residuals
## W = 0.99791, p-value = 0.2473
12
Test de Anderson-Darling
library(nortest)
ad.test(modelo1$residuals)
##
## Anderson-Darling normality test
##
## data: modelo1$residuals
## A = 90.606, p-value < 2.2e-16
ad.test(modelo2$residuals)
##
## Anderson-Darling normality test
##
## data: modelo2$residuals
## A = 0.45538, p-value = 0.2674
13