Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
000284-6] ECONOMETRIA
C.H.: 68 horas
quarta-feira - 08h00m a 10h00m
quinta-feira 10h00m a 12h00m
RESET
5.281559
Probability
0.001932
15.74446
Probability
0.001279
Test Equation:
Dependent Variable: QSOJA
Method: Least Squares
Date: 06/06/03 Time: 14:57
Coefficient
Std. Error
t-Statistic
Prob.
FERTILIZANTE
304.1298
135.0469
2.252031
0.0263
TRATOR
18591.29
8231.767
2.258481
0.0259
MO
115237.7
51069.36
2.256493
0.0260
-230604.7
101861.3
-2.263908
0.0255
FITTED^2
2.664804
1.165269
2.286857
0.0241
FITTED^3
-0.005642
0.002453
-2.300025
0.0233
FITTED^4
4.43E-06
1.92E-06
2.302617
0.0232
R-squared
0.532456
322.2544
Adjusted R-squared
0.506954
56.01272
S.E. of regression
39.33059
10.23985
170158.4
Schwarz criterion
10.40510
F-statistic
20.87869
Prob(F-statistic)
0.000000
Log likelihood
Durbin-Watson stat
-592.0310
0.770973
Rvelho = 0,46511.
Rnovo = 0,532456.
Foram adicionadas 3 variveis, portanto,
m=3.
n=117
contendo 7 parmetros.
F=5,281
. disp Ftail(3,110,5.281)
=>P-value =.00193364
H0: os coeficientes das variveis esperadas
so nulos
Rejeito H0 a 1% de significncia
10
pacote Reset
Traz o RESET de Ramsey para 1, 2 e 3
variveis em potncia...
2 3 4
Y ,Y ,Y
11
DeBenedictis-Giles Specification
FReset
Usa uma distribuio de Fourier (ao invs da srie
de Taylor do teste de Ramsey)
O teste RESET de Ramsey tem problemas quando o
modelo tiver autocorrelao dos resduos
FRESETL - transformao linear das variveis
previstas
FRESETS - transformao senoidal das variveis
previstas
O teste FRESETL geralmente o melhor quando o
modelo mal especificado esttico, enquanto o teste
FRESETS melhor quando o modelo mal
especificado pela omisso de um efeito dinmico
(DeBenedicitis e Giles, 1998, p.38).
12
13
14
Link Test
15
. linktest
Source
16
SS
df
MS
Model
Residual
183049.122
180892.159
2
114
91524.561
1586.77332
Total
363941.281
116
3137.42483
qsoja
Coef.
_hat
_hatsq
_cons
6.438339
-.0084946
-858.0958
Std. Err.
1.848219
.0028829
292.9131
t
3.48
-2.95
-2.93
Number of obs
F( 2,
114)
Prob > F
R-squared
Adj R-squared
Root MSE
P>|t|
0.001
0.004
0.004
=
=
=
=
=
=
117
57.68
0.0000
0.5030
0.4942
39.834
10.09965
-.0027835
-277.8372
Outros indicadores
17
18
Stata .estat ic
19
20
. ttest residuos == 0
21
No Stata
22
23
. ttest residuos == 0
One-sample t test
Variable
Obs
Mean
residuos
117
-6.88e-08
mean = mean(residuos)
Ho: mean = 0
Ha: mean < 0
Pr(T < t) = 0.5000
24
Std. Err.
Std. Dev.
3.787267
40.96555
t =
degrees of freedom =
Ha: mean != 0
Pr(|T| > |t|) = 1.0000
7.501159
-0.0000
116
No Eviews
25
26
27
28
Erros No Normais
1
2
2
1
BJ n p S 4 K 3 ~ 2gl 2
6
em que S a medida de assimetria (skewness) e K a medida de
curtose
n o nmero de observaes e p o nmero de parmetros
Ho: erros so normais => por exemplo, probabilidade acima de 10%
H1: erros no so normais
Uma probabilidade (p-value) pequena leva rejeio de que
os erros so normais
29
N
Var
30
Yi Y
t 1 Var
2 Var s
N 1
N
. sktest residuos
Skewness/Kurtosis tests for Normality
31
Variable
Obs
Pr(Skewness)
Pr(Kurtosis)
residuos
117
0.0016
0.0344
joint
adj chi2(2)
Prob>chi2
12.12
0.0023
32
Erros so Homocedsticos
tm Varincia Constante
33
Heterogeneidade da amostra
Investigao da heterocedasticidade
34
Investigao da heterocedasticidade
35
Park
36
37
Eq auxiliar de Park
Dependent Variable: LOGRESID02_2
Method: Least Squares
Date: 10/29/14 Time: 10:33
Sample: 1 117
Included observations: 117
38
Variable
Coefficient
Std. Error
t-Statistic
Prob.
C
FERTILIZANTE
8.365790
-0.103490
0.763343
0.040618
10.95941
-2.547862
0.0000
0.0122
R-squared
Adjusted R-squared
S.E. of regression
Sum squared resid
Log likelihood
F-statistic
Prob(F-statistic)
0.053433
0.045201
1.670479
320.9076
-225.0411
6.491600
0.012158
6.461117
1.709563
3.881044
3.928261
3.900214
1.337139
Breusch-Pagan-Godfrey
Heterocedasticidade
39
Teste LM Breusch-Pagan-Godfrey
40
Teste LM Breusch-Pagan-Godfrey
41
Teste LM Breusch-Pagan-Godfrey
42
=
=
15.65
0.0013
Teste de White
estima-se a regresso inicial e obtm-se os resduos i;
2. faz-se uma regresso auxiliar do tipo
i2= 1 + 2 X2i + 3X3i + 4 X2i2+ 5X3i2 + 6 X2i.X3i + i
1.
43
com gl = 5
44
Teste de White
45
4.638220
32.83525
Probability
Probability
0.000034
0.000143
Test Equation:
Dependent Variable: RESID^2
Method: Least Squares
Date: 06/06/03 Time: 18:01
Sample: 1988:09 1998:05
Included observations: 117
Variable
Coefficient
Std. Error
t-Statistic
Prob.
C
FERTILIZANTE
FERTILIZANTE^2
FERTILIZANTE*TRA
TOR
FERTILIZANTE*MO
TRATOR
TRATOR^2
TRATOR*MO
MO
MO^2
-20557.49
445.3517
25.26911
-120.1672
9888.589
600.7180
15.80557
87.69892
-2.078910
0.741366
1.598748
-1.370224
0.0400
0.4601
0.1128
0.1735
-13077.63
864.9398
309.3549
-22449.97
426444.0
-365960.5
3137.312
3116.365
253.6114
12081.31
90390.39
130236.2
-4.168419
0.277548
1.219799
-1.858240
4.717802
-2.809975
0.0001
0.7819
0.2252
0.0659
0.0000
0.0059
R-squared
Adjusted R-squared
S.E. of regression
Sum squared resid
Log likelihood
Durbin-Watson stat
0.280643
0.220136
2599.568
7.23E+08
-1080.772
1.549746
1663.833
2943.689
18.64567
18.88176
4.638220
0.000034
46
SS
df
MS
Model
Residual
169272.79
194668.491
3
113
56424.2634
1722.73001
Total
363941.281
116
3137.42483
qsoja
Coef.
fertilizante
trator
mo
_cons
-.5535435
-33.68994
-209.1407
494.9657
Std. Err.
1.058904
3.741035
107.8926
25.57225
t
-0.52
-9.01
-1.94
19.36
Number of obs
F( 3,
113)
Prob > F
R-squared
Adj R-squared
Root MSE
P>|t|
0.602
0.000
0.055
0.000
=
=
=
=
=
=
117
32.75
0.0000
0.4651
0.4509
41.506
1.544337
-26.27827
4.614037
545.629
. white
White's test for Ho: homoscedasticity
against Ha: unrestricted heteroscedasticity
test statistic W =
Pr(chi2(8) > W) =
47
32.83525
0.0001
Number of obs
F( 3,
113)
Prob > F
R-squared
Root MSE
qsoja
Coef.
fertilizante
trator
mo
_cons
-.5535435
-33.68994
-209.1407
494.9657
48
Robust
Std. Err.
1.272433
3.794883
115.177
26.4601
t
-0.44
-8.88
-1.82
18.71
P>|t|
0.664
0.000
0.072
0.000
=
=
=
=
=
117
33.94
0.0000
0.4651
41.506
1.967376
-26.17159
19.0456
547.388
Erros So No-Autocorrelacionados
Os erros aleatrios so independentes, ou ainda, no existe
=Independentes
correlao serial dos resduos
Causas:
Variveis no especificadas
Forma funcional
Inrcia temporal
49
Figura 1. Representaes da disperso dos pontos em torno de uma reta estimada ilustrao
da correlao serial.
50
Figura 1. Padres de correlao entre os distrbios. (a) correlao serial positiva; (b)
correlao serial negativa; e (c) correlao nula.
51
Matriz de varincia-covarincia
12 1 2
2 1
2
E E
n1 n 2
2 0
2
0
E 2 I E
0
0
52
1 n
2 n
2
n
0
Se i=j =>
E( )=2
Se ij =>
E( )=0
Durbin-Watson
Autocorrelao de 1. Ordem:
Teste de Durbin-Watson:
t = .t-1 + t
53
Estatstica de Teste:
=0
= +1
= -1
deseja-se DW prximo de 2
54
Durbin-Watson - deficincias
Deficincias do DW:
55
reas inconclusivas
s testa primeira ordem
deve incluir intercepto
no vlido quando o modelo tem varivel
dependente defasada como varivel explicativa
Teste de h de Durbin
1.()
= .
h ~ N(0,1)
comparar com o limite de 1,96 p/ 5%
T nmero de observaes
56
Teste de Breusch-Godfrey = LM
57
58
b)
c)
d)
59
LM BG
60
'
1
'
e'
X
(
X
X
)
X
2
2
0
0 0
0e
( n p )R0 ( n p )
~
p
e' e
61
t X t 1t 1 2 t 2 3t 3
p t p t
1
1
X0
et p ,1
et p ,2
et p ,3
X 11
X 21
et 1,1
X 12
X 22
et 1,2
X 13
X 23
et 1,3
Anlise do LMBG
62
Stata
declarar dataset como time series
tab5_6_moeda gujarati_p157.dta
. tsset ano, yearly
time variable:
delta:
. regress pnb m1
Source
63
m2 m3 l
SS
Model
Residual
7912655.56
38065.6381
4
9
1978163.89
4229.51534
Total
7950721.2
13
611593.939
pnb
Coef.
m1
m2
m3
l
_cons
-6.014162
-.3647407
2.336468
.0308376
913.4892
Number of obs
9)
F( 4,
Prob > F
R-squared
Adj R-squared
Root MSE
MS
df
Std. Err.
6.400151
.8782297
1.989016
1.687075
720.1114
t
-0.94
-0.42
1.17
0.02
1.27
P>|t|
0.372
0.688
0.270
0.986
0.236
=
=
=
=
=
=
14
467.70
0.0000
0.9952
0.9931
65.035
8.463986
1.621953
6.835935
3.847267
2542.494
. estat dwatson
Durbin-Watson d-statistic(
64
5,
14) =
.70426
65
Stata Breusch-Godfrey
66
. estat bgodfrey
. estat bgodfrey, lags(1 2 3 4 5 6)
Breusch-Godfrey LM test for autocorrelation
lags(p)
chi2
1
2
3
4
5
6
9.424
9.950
12.242
12.352
12.556
12.707
df
1
2
3
4
5
6
67
68
SS
df
MS
Model
Residual
34460.1927
0
7
0
4922.88467
.
Total
34460.1927
4922.88467
res
Coef.
Std. Err.
m1
m2
m3
l
0
-1.104659
-3.957807
4.015903
(omitted)
.
.
.
res
L1.
L2.
L3.
L4.
L5.
L6.
-.0094944
.9671443
-1.506737
0
0
-.842507
_cons
374.7052
Number of obs
F( 7,
0)
Prob > F
R-squared
Adj R-squared
Root MSE
P>|t|
=
=
=
=
=
=
8
.
.
1.0000
.
0
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
(omitted)
(omitted)
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Econometria
- Prof..Adriano Figueiredo
Exemplo Barium.dta
. regress l_chnimp l_chempi l_gas l_rtwex
Source
69
SS
df
MS
Model
Residual
17.8780226
45.7742259
3
127
5.95934086
.360426976
Total
63.6522485
130
.489632681
l_chnimp
Coef.
l_chempi
l_gas
l_rtwex
_cons
3.045596
.3441587
.7159855
-19.63091
Std. Err.
.4787299
.9108141
.349141
21.19183
t
6.36
0.38
2.05
-0.93
Number of obs
F( 3,
127)
Prob > F
R-squared
Adj R-squared
Root MSE
P>|t|
0.000
0.706
0.042
0.356
=
=
=
=
=
=
131
16.53
0.0000
0.2809
0.2639
.60036
3.992916
2.146495
1.406872
22.3039
chi2
df
11.121
14.781
16.505
19.404
19.447
19.679
21.542
21.606
24.942
24.942
25.346
25.687
1
2
3
4
5
6
7
8
9
10
11
12
70
71
SS
df
MS
Model
Residual
7.37066877
30.6153298
15
103
.491377918
.297236212
Total
37.9859986
118
.321915242
Std. Err.
Number of obs
F( 15,
103)
Prob > F
R-squared
Adj R-squared
Root MSE
P>|t|
=
=
=
=
=
=
119
1.65
0.0726
0.1940
0.0767
.54519
res
Coef.
l_chempi
l_gas
l_rtwex
-.5981542
1.098273
-.0741444
.5482505
1.0188
.3315545
-1.09
1.08
-0.22
0.278
0.284
0.823
-1.68548
-.9222768
-.7317046
.4891713
3.118823
.5834159
res
L1.
L2.
L3.
L4.
L5.
L6.
L7.
L8.
L9.
L10.
L11.
L12.
.2030911
.1373696
.1555331
-.1545982
-.0514118
.0091389
.1483849
.0658224
-.1264921
.0077911
-.0334636
-.055116
.0981034
.0996312
.1010439
.1011423
.0980085
.0968191
.0966711
.0976796
.0964877
.0967757
.0951027
.0927521
2.07
1.38
1.54
-1.53
-0.52
0.09
1.53
0.67
-1.31
0.08
-0.35
-0.59
0.041
0.171
0.127
0.129
0.601
0.925
0.128
0.502
0.193
0.936
0.726
0.554
.0085262
-.0602253
-.0448636
-.35519
-.2457887
-.182879
-.0433395
-.1279021
-.3178528
-.1841406
-.2220774
-.2390679
.397656
.3349645
.3559298
.0459936
.142965
.2011568
.3401092
.2595469
.0648685
.1997229
.1551502
.128836
_cons
-21.84891
22.81911
-0.96
0.341
-67.10523
23.40741
Econometria
- Prof. Adriano
Figueiredo
SS
df
MS
Model
Residual
6749.4506
5042.58207
2
25
3374.7253
201.703283
Total
11792.0327
27
436.741951
rr
Coef.
growth
inflation
_cons
3.943315
-2.499426
3.531812
Std. Err.
1.293445
1.082101
8.111369
t
3.05
-2.31
0.44
Number of obs
F( 2,
25)
Prob > F
R-squared
Adj R-squared
Root MSE
P>|t|
0.005
0.029
0.667
=
=
=
=
=
=
28
16.73
0.0000
0.5724
0.5382
14.202
6.607214
-.2707959
20.23749
. estat dwatson
Durbin-Watson d-statistic(
72
3,
28) =
1.896592
Correo de autocorrelao
Mudar Especificao?
Transformar variveis por um rho
conhecido?
No Eviews => inserir termos AR(p) na
especificao das variveis da equao
74
Yt Yt 1 1 1 2 X t X t 1 t
ou
Y* = 1* + 2.X1* + t*
4. Recalcula-se (2) e verifica-se a convergncia para
.
5. Repetem-se os passos (2) a (4) at que a
convergncia seja menor que 0,01.
75
Correo
76
Estimao do Eviews
77
Ex12_22.dta
78
79
80
Qualidade do modelo
. estat ic
Akaike's information criterion and Bayesian information criterion
81
Model
Obs
ll(null)
ll(model)
df
AIC
BIC
30
31.93108
-47.86216
-36.65258
Note:
82
2.
Aumenta erro-padro
3.
4.
Deteco da Multicolinearidade
1.
2.
3.
4.
83
continuao
5. Regra de Klein: a multicolinearidade no
prejudicial se
R2Y
84
Regra de Klein
Regresses auxiliares
. regress
index g interest p
. regress
Source
SS
df
MS
Model
Residual
268.400306
11.5996943
3
11
89.4667686
1.05451766
Total
280
14
20
index
Coef.
g
interest
p
_cons
26.16777
.0735369
.0125335
-26.31751
. regress
Std. Err.
2.904047
.1852301
.2060625
2.840748
t
9.01
0.40
0.06
-9.26
P>|t|
0.000
0.699
0.953
0.000
=
=
=
=
=
=
15
84.84
0.0000
0.9586
0.9473
1.0269
SS
df
MS
.344829607
.014918823
3
11
.114943202
.001356257
Total
.35974843
14
.025696316
Coef.
interest
p
index
_cons
.002434
.0006913
.0336554
.9953316
Source
Std. Err.
.0066499
.0073883
.003735
.036028
19.77601
-.3341518
-.4410071
-32.56995
0.37
0.09
9.01
27.63
Number of obs
F( 3,
11)
Prob > F
R-squared
Adj R-squared
Root MSE
P>|t|
0.721
0.927
0.000
0.000
SS
df
MS
Model
Residual
80.4214447
30.300656
3
11
26.8071482
2.75460509
Total
110.722101
14
7.90872148
32.55954
.4812257
.466074
-20.06507
interest
Coef.
p
index
g
_cons
.5063365
.1920928
4.943506
-3.815768
. regress
Model
Residual
interest p index g
Number of obs
F( 3,
11)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
15
9.73
0.0020
0.7263
0.6517
1.6597
g interest p index
Source
85
Number of obs
F( 3,
11)
Prob > F
R-squared
Adj R-squared
Root MSE
Source
.2960552
.4838571
13.50622
13.57322
t
1.71
0.40
0.37
-0.28
SS
df
0.115
0.699
0.721
0.784
MS
Model
Residual
28.3339611
24.8261769
3
11
9.44465369
2.25692518
Total
53.160138
14
3.79715271
Coef.
index
g
interest
_cons
.0268246
1.150325
.4148557
1.864211
.0170704
.0169528
.0418761
1.074629
P>|t|
1.15795
1.257055
34.67049
26.05869
interest
15
84.75
0.0000
0.9585
0.9472
.03683
-.0122024
-.0155702
.0254347
.9160345
=
=
=
=
=
=
p index g
Std. Err.
Std. Err.
.4410241
12.29472
.2425664
12.31728
t
0.06
0.09
1.71
0.15
Number of obs
F( 3,
11)
Prob > F
R-squared
Adj R-squared
Root MSE
P>|t|
0.953
0.927
0.115
0.882
=
=
=
=
=
=
15
4.18
0.0333
0.5330
0.4056
1.5023
.9975121
28.21082
.9487406
28.97435
FIV ou VIF
86
87
88
89
FIV no GRETL
=> Teste de
Colinearidade
90
VIF/FIV no
EViews =>
Coefficient
Diagnostics
91
STATA
92
GRETL
EVIEWS
93
g p index
interest
Variable
Partial
Corr.
Semipartial
Corr.
Partial
Corr.^2
Semipartial
Corr.^2
Significance
Value
p
index
interest
0.0282
0.9384
0.1097
0.0057
0.5533
0.0225
0.0008
0.8807
0.0120
0.0000
0.3061
0.0005
0.9271
0.0000
0.7213
. pcorr
(obs=15)
index g p interest
94
Variable
Partial
Corr.
Semipartial
Corr.
Partial
Corr.^2
Semipartial
Corr.^2
Significance
Value
g
p
interest
0.9384
0.0183
0.1189
0.5530
0.0037
0.0244
0.8807
0.0003
0.0141
0.3058
0.0000
0.0006
0.0000
0.9526
0.6990
. pcorr p interest
(obs=15)
index g
index
interest
0.9384
0.1097
0.5533
0.0225
0.8807
0.0120
0.3061
0.0005
0.0000
0.7213
index g p interest
Variable
Partial
Corr.
Semipartial
Corr.
Partial
Corr.^2
Semipartial
Corr.^2
Significance
Value
g
p
interest
0.9384
0.0183
0.1189
0.5530
0.0037
0.0244
0.8807
0.0003
0.0141
0.3058
0.0000
0.0006
0.0000
0.9526
0.6990
. pcorr p interest
(obs=15)
index g
Variable
Partial
Corr.
Semipartial
Corr.
Partial
Corr.^2
Semipartial
Corr.^2
Significance
Value
interest
index
g
0.4583
0.0183
0.0282
0.3524
0.0125
0.0193
0.2101
0.0003
0.0008
0.1242
0.0002
0.0004
0.1152
0.9526
0.9271
. pcorr interest
(obs=15)
index g p
95
Variable
Partial
Corr.
Semipartial
Corr.
Partial
Corr.^2
Semipartial
Corr.^2
Significance
Value
index
g
p
0.1189
0.1097
0.4583
0.0626
0.0577
0.2698
0.0141
0.0120
0.2101
0.0039
0.0033
0.0728
0.6990
0.7213
0.1152
Solues para a
multicolinearidade
96
Omisso de variveis
Aumentar o tamanho da amostra
Transformar as variveis problemticas
SS
df
MS
Model
Residual
.015861368
.000431814
4
10
.003965342
.000043181
Total
.016293182
14
.001163799
Coef.
index
g
interest
p
_cons
-.0165896
.6703036
-.0024281
.0000639
-.5090685
Std. Err.
.0019294
.0537998
.0011938
.0013188
.0539332
t
-8.60
12.46
-2.03
0.05
-9.44
Number of obs
F( 4,
10)
Prob > F
R-squared
Adj R-squared
Root MSE
P>|t|
0.000
0.000
0.069
0.962
0.000
=
=
=
=
=
=
15
91.83
0.0000
0.9735
0.9629
.00657
-.0122906
.7901771
.0002318
.0030024
-.3888979
97
SS
df
MS
Model
Residual
.01266895
.003624232
3
11
.004222983
.000329476
Total
.016293182
14
.001163799
Coef.
g
interest
p
_cons
.23619
-.003648
-.000144
-.0724708
Std. Err.
.051332
.0032741
.0036424
.0502131
t
4.60
-1.11
-0.04
-1.44
Number of obs
F( 3,
11)
Prob > F
R-squared
Adj R-squared
Root MSE
P>|t|
0.001
0.289
0.969
0.177
=
=
=
=
=
=
15
12.82
0.0007
0.7776
0.7169
.01815
.349171
.0035583
.0078727
.0380476
98
99
Correlao simples
duas a duas ver Gujarati 5ed
(p355, Tabela 10.9)
10
0
Regresses
auxiliares Klein
10
1
Regresses
auxiliares Klein
10
2
Regresses
auxiliares Klein
10
3
10
4
Variable
VIF
1/VIF
x2
x6
x5
x1
x3
x4
1788.51
758.98
399.15
135.53
33.62
3.59
0.000559
0.001318
0.002505
0.007378
0.029745
0.278635
Mean VIF
519.90
10
5
10
6
10
7
10
8