Documente Academic
Documente Profesional
Documente Cultură
1 Introducción
4 Inferencia Estadı́stica
y = a + bx
yt = α + βxt + ut
donde t = 1, 2, 3, 4, 5.
yt
ût
ˆyt
xt x
α̂ = ȳ − β̂x̄
Yt = e α Xtβ e ut
β
Yt = α + + ut
Xt
grados de libertad.
4 Elegir un nivel de significancia, que representa la región donde se
aceptación y rechazo.
6 Use la tabla de la distribución t-student para obtener los valores
crı́ticos.
7 Realizar la prueba: si el t-estadı́stico cae en la región de rechazo
>if(!require("XLConnect")){
+ install.packages("XLConnect")
+ library("XLConnect")
+ }
> data$rsandp=100*c(NA,diff(log(data$SANDP)))
> data$rford=100*c(NA,diff(log(data$FORD)))
> data$ersandp=data$rsandp-data$USTB3M/12
> data$erford=data$rford-data$USTB3M/12
Call:
lm(formula = erford ˜ ersandp, data = data)
Residuals:
Min 1Q Median 3Q Max
-48.758 -7.248 -1.305 5.755 63.299
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.3199 1.0864 -0.294 0.769
ersandp 2.0262 0.2377 8.523 2.98e-14 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> hm = rbind(c(0,1))
> rhs = c(1)
> linearHypothesis(capm,hm,rhs)
Hypothesis:
ersandp = 1
> hm = rbind(c(1,0),c(0,1))
> rhs = c(0,2)
> linearHypothesis(capm,hm,rhs)
Hypothesis:
(Intercept) = 0
ersandp = 2
data$dinflation=c(NA,diff(data$inflation))
data$mustb3m=data$USTB3M/12
data$rterm=c(NA,diff(data$term))
data$ersandp=data$rsandp-data$mustb3m
data$ermsoft=data$rmsoft-data$mustb3m
head(data)
PhD Rafael Nivı́n Unidad de Postgrado FIEECS 2019 33 / 38
#3 Modelo de Regresión lineal: APT
Residuals:
Min 1Q Median 3Q Max
-66.985 -3.643 1.105 6.661 26.587
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -1.514e-01 9.048e-01 -0.167 0.8672
ersandp 1.360e+00 1.566e-01 8.687 <2e-16 ***
dprod -1.426e+00 1.324e+00 -1.076 0.2825
dcredit -4.053e-05 7.640e-05 -0.530 0.5961
dinflation 2.960e+00 2.166e+00 1.366 0.1728
dmoney -1.109e-02 3.518e-02 -0.315 0.7528
dspread 5.367e+00 6.914e+00 0.776 0.4382
rterm 4.316e+00 2.515e+00 1.716 0.0872 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Hypothesis:
dprod = 0
dcredit = 0
dinflation = 0
dmoney = 0
dspread = 0
t test of coefficients:
H0 : ρ1 = ρ2 = ... = ρr = 0
Ha : ρ1 6= 0 or ... or ρr 6= 0
#6 Autocorrelación
> bgtest(apt)
data: apt
LM test = 2.3624, df = 1, p-value = 0.1243
> bgtest(apt,order=10)
data: apt
LM test = 22.623, df = 10, p-value = 0.01223
data: apt$residuals
X-squared = 1845.4, df = 2, p-value < 2.2e-16