ECONOMETRIA I
1) No Cap. 3, refazer o exemplo da pg. 23 (item 3.2.2) Funo
investimento
Ns consideramos um exemplo baseado em dados macroeconmicos na tabela do
apndice F3.1. Para estimar uma equao de investimento, ns primeiro convertemos o
investimento e a srie do PIB da tabela F3.1 em termos reais dividindo pelo ndice de preos e
ento escalamos as duas sries que esto medidas em trilhes de dlares. As outras duas
variveis so tendncia de tempo, taxa de juros e a taxa de inflao computada como
percentagem de mudana do ndice de inflao. Produzindo a matriz listada na tabela 3.1.
Considerando primeiro uma regresso do investimento real sobre uma constante, a tendncia
de tempo e o PIB real que corresponde a x1, x2 e x3.
Inserindo as variveis especficas do exemplo, ns temos:
b1n + b2iTi + b3iGi = iYi
b1iTi + b2Ti2 b3iTiGi = iTiYi
b1iGi + b2iTiGi + b3iGi2 = iGiYi
Uma soluo pode ser obtida primeiro dividindo a primeira equao por n e
rearranjando para obter:
b1 = Y - b2T - b3G
= 0.20333 - b2 x 8 - b3 x 1.2873
Este resultado mostra a natureza da soluo para a inclinao, que pode ser
calculado da soma dos quadrados e atravs do produto dos desvios das variveis.
b2 = -0.0171984
b3 = 0.653723
Com esta soluo o intercepto pode ser calculado:
b1 = - 0.500639
Suponha que ns apenas regressemos o investimento sobre a constante e o PIB,
omitindo a tendncia de tempo. Pelo menos algumas das correlaes que ns observamos nos
dados ser explicada porque ambos investimento e PIB real tem uma obvia tendncia de
tempo.
Regresso Bivariada da varivel y sobre a constante e a varivel x, ns
encontramos que a inclinao nesta regresso reduzida seria:
byg = igiyi / igi2 = 0.184078
iti2igi2.
ECONOMETRIA I
Number of obs
F( 2,
12)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
15
141.43
0.0000
0.9593
0.9525
.00745
-----------------------------------------------------------------------------y |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------t | -.01 71984
.0021642
-7.95
0.000
-.0219139
-.012483
g |
.6537234
.0603897
10.83
0.000
.5221457
.7853012
_cons | -.5006391
.0609325
-8.22
0.000
-.6333997
-.3678785
-----------------------------------------------------------------------------. matrix list e(b)
e(b)[1,3]
y1
t
-.01719844
g
.65372345
_cons
-.5006391
.
. *2) Y = b1 + b3G,
. *Investimento real (Y) sobre o Produto real (G)
. regress y g
Source |
SS
df
MS
-------------+-----------------------------Model | .012185318
1 .012185318
Residual | .004168014
13 .000320616
-------------+-----------------------------Total | .016353333
14 .001168095
Number of obs
F( 1,
13)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
15
38.01
0.0000
0.7451
0.7255
.01791
-----------------------------------------------------------------------------y |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------g |
.1840785
.0298592
6.16
0.000
.1195717
.2485852
_cons |
-.033637
.0387157
-0.87
0.401
-.1172772
.0500032
-----------------------------------------------------------------------------. matrix list e(b)
e(b)[1,2]
y1
g
.18407845
_cons
-.03363699
.
. *3) Calculando byg-t (estimador da regresso de y e g na presena de t)
. * Foram realizadas regresses parciais
. quietly regress y t
. matrix list e(b)
e(b)[1,2]
y1
t
.00572857
_cons
.15750476
ECONOMETRIA I
. quietly regress t g
. matrix list e(b)
e(b)[1,2]
y1
g
27.307411
_cons
-27.15374
. regress g t
Source |
SS
df
MS
-------------+-----------------------------Model | .344401449
1 .344401449
Residual |
.0152079
13 .001169838
-------------+-----------------------------Total | .359609349
14 .025686382
Number of obs
F( 1,
13)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
15
294.40
0.0000
0.9577
0.9545
.0342
-----------------------------------------------------------------------------g |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------t |
.0350714
.002044
17.16
0.000
.0306556
.0394873
_cons |
1.006762
.0185844
54.17
0.000
.9666127
1.046911
-----------------------------------------------------------------------------.
.
.
.
.
Source |
SS
df
MS
-------------+-----------------------------Model | .015902522
4 .003975631
Residual | .000450811
10 .000045081
-------------+-----------------------------Total | .016353333
14 .001168095
Number of obs
F( 4,
10)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
15
88.19
0.0000
0.9724
0.9614
.00671
-----------------------------------------------------------------------------y |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------t | -.0165804
.0019718
-8.41
0.000
-.0209738
-.012187
g |
.6703836
.0549972
12.19
0.000
.5478423
.7929249
r | -.0023259
.0012189
-1.91
0.085
-.0050417
.0003899
p |
-.000094
.0013475
-0.07
0.946
-.0030964
.0029084
_cons | -.5090709
.0551276
-9.23
0.000
-.631903
-.3862389
-----------------------------------------------------------------------------. matrix list e(b)
e(b)[1,5]
y1
t
-.0165804
g
.67038361
r
-.00232593
p
-.00009401
_cons
-.50907094
.
end of do-file
ECONOMETRIA I
. summarize
Variable |
Obs
Mean
Std. Dev.
Min
Max
-------------+-------------------------------------------------------y |
11
1945
3.316625
1940
1950
x |
11
323.2727
35.07162
241
371
c |
11
273.2727
35.52208
226
325
war |
11
.3636364
.504525
0
1
. *Regresso sem a varivel binria - como se todos os periodos fossem normais
. regress c x
Source |
SS
df
MS
-------------+-----------------------------Model | 5768.20676
1 5768.20676
Residual | 6849.97506
9
761.10834
-------------+-----------------------------Total | 12618.1818
10 1261.81818
Number of obs
F( 1,
9)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
11
7.58
0.0224
0.4571
0.3968
27.588
-----------------------------------------------------------------------------c |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------x |
.6848014
.2487525
2.75
0.022
.1220841
1.247519
_cons |
51.89511
80.84397
0.64
0.537
-130.9867
234.7769
-----------------------------------------------------------------------------. *Uso da varivel binria "war", sendo 1 nos anos de 1942-1945 e 0 nos demais
. *Regresso com a varivel binria "war" desconsiderando os anos de guerra
. regress c x if war==0
Source |
SS
df
MS
-------------+-----------------------------Model | 8164.52512
1 8164.52512
Residual | 549.189162
5 109.837832
-------------+-----------------------------Total | 8713.71429
6 1452.28571
Number of obs
F( 1,
5)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
7
74.33
0.0003
0.9370
0.9244
10.48
-----------------------------------------------------------------------------c |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------x |
.853061
.0989443
8.62
0.000
.5987167
1.107405
_cons |
15.90735
31.64252
0.50
0.637
-65.43234
97.24705
-----------------------------------------------------------------------------. *Uso da varivel binria "war", sendo 1 nos anos de 1942-1945 e 0 nos demais
. *Regresso com a varibel binria "war" considerando todos os anos
. regress c x war
Source |
SS
df
MS
-------------+-----------------------------Model | 11941.7257
2 5970.86283
Residual | 676.456151
8 84.5570189
-------------+-----------------------------Total | 12618.1818
10 1261.81818
Number of obs
F( 2,
8)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
11
70.61
0.0000
0.9464
0.9330
9.1955
-----------------------------------------------------------------------------c |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------x |
.8575111
.0853405
10.05
0.000
.6607155
1.054307
war | -50.68974
5.932373
-8.54
0.000
-64.36981
-37.00966
_cons |
14.4954
27.29948
0.53
0.610
-48.45731
77.44812
-----------------------------------------------------------------------------end of do-file
ECONOMETRIA I
Number of obs
F( 3,
11)
Prob > F
R-squared
Adj R-squared
Root MSE
=
15
=
0.82
= 0.5080
= 0.1834
= -0.0394
= .26342
-----------------------------------------------------------------------------wage |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------educ |
.014539
.0490215
0.30
0.772
-.0933566
.1224346
exp |
.07103
.0480342
1.48
0.167
-.0346924
.1767525
ability |
.0266154
.0991173
0.27
0.793
-.1915404
.2447711
_cons |
1.66364
.6185532
2.69
0.021
.3022133
3.025066
-----------------------------------------------------------------------------.
. *b)Regresso de Y sobre X1 e X2
. regress wage educ exp ability mothered fathered sibs
Source |
SS
df
MS
-------------+-----------------------------Model | .482427232
6 .080404539
Residual |
.45226629
8 .056533286
-------------+-----------------------------Total | .934693521
14 .066763823
Number of obs
F( 6,
8)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
15
1.42
0.3140
0.5161
0.1532
.23777
-----------------------------------------------------------------------------wage |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------educ |
.0258221
.0446859
0.58
0.579
-.0772238
.1288681
exp |
.1033913
.0473454
2.18
0.061
-.0057875
.21257
ability |
.0307435
.1212013
0.25
0.806
-.2487472
.3102343
mothered |
.1016307
.070175
1.45
0.186
-.0601932
.2634546
fathered |
.0016443
.0446491
0.04
0.972
-.1013167
.1046054
sibs |
.0591692
.069018
0.86
0.416
-.0999866
.218325
_cons |
.0489959
.9488077
0.05
0.960
-2.138959
2.23695
-----------------------------------------------------------------------------. *c)Regresso de cada varivel x2 sobre as variveis x1
. regress mothered educ exp ability
Source |
SS
df
MS
-------------+-----------------------------Model | 6.55275053
3 2.18425018
Residual | 18.3805828
11 1.67096207
-------------+-----------------------------Total | 24.9333333
14 1.78095238
Number of obs
F( 3,
11)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
15
1.31
0.3211
0.2628
0.0618
1.2927
-----------------------------------------------------------------------------mothered |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------educ | -.0837141
.2405547
-0.35
0.734
-.6131716
.4457433
exp | -.2859633
.2357097
-1.21
0.250
-.8047569
.2328303
ability |
.5028718
.4863813
1.03
0.323
-.5676462
1.57339
_cons |
13.76043
3.03532
4.53
0.001
7.079742
20.44113
-----------------------------------------------------------------------------. regress fathered educ exp ability
Source |
SS
df
MS
-------------+-----------------------------Model | 7.32880185
3 2.44293395
Residual | 40.0045315
11 3.63677559
-------------+-----------------------------Total | 47.3333333
14 3.38095238
Number of obs
F( 3,
11)
Prob > F
R-squared
Adj R-squared
Root MSE
=
15
=
0.67
= 0.5870
= 0.1548
= -0.0757
=
1.907
-----------------------------------------------------------------------------fathered |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+----------------------------------------------------------------
ECONOMETRIA I
educ |
.0267585
.354886
0.08
0.941
-.7543403
.8078573
exp |
.0011246
.3477382
0.00
0.997
-.7642422
.7664913
ability |
.8727106
.7175494
1.22
0.249
-.706605
2.452026
_cons |
11.99981
4.477951
2.68
0.021
2.143909
21.85572
-----------------------------------------------------------------------------. regress sibs educ exp ability
Source |
SS
df
MS
-------------+-----------------------------Model | 8.59734061
3
2.8657802
Residual | 13.8026594
11 1.25478722
-------------+-----------------------------Total |
22.4
14
1.6
Number of obs
F( 3,
11)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
15
2.28
0.1357
0.3838
0.2158
1.1202
-----------------------------------------------------------------------------sibs |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------educ | -.0476471
.2084566
-0.23
0.823
-.506457
.4111628
exp | -.0557793
.2042581
-0.27
0.790
-.5053484
.3937897
ability | -.9577689
.4214816
-2.27
0.044
-1.885444
-.0300942
_cons |
3.319784
2.630305
1.26
0.233
-2.469479
9.109047
-----------------------------------------------------------------------------.
. *d)Regresso de Y sobre X1 e X2, omitindo a constante.
. regress wage educ exp ability mothered fathered sibs, noconstant
Source |
SS
df
MS
-------------+-----------------------------Model | 64.0950841
6
10.682514
Residual | .452417043
9
.05026856
-------------+-----------------------------Total | 64.5475011
15 4.30316674
Number of obs
F( 6,
9)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
15
212.51
0.0000
0.9930
0.9883
.22421
-----------------------------------------------------------------------------wage |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------educ |
.0272969
.0324092
0.84
0.421
-.0460178
.1006116
exp |
.1041425
.0424856
2.45
0.037
.0080334
.2002515
ability |
.028621
.1075159
0.27
0.796
-.2145969
.2718389
mothered |
.1039024
.0515562
2.02
0.075
-.0127259
.2205307
fathered |
.0017645
.0420454
0.04
0.967
-.0933489
.0968778
sibs |
.0589675
.0649773
0.91
0.388
-.0880214
.2059563
-----------------------------------------------------------------------------. *e)Regresso de Y sobre X1 e X2, mantendo a constante
. regress wage educ exp ability mothered fathered sibs
Source |
SS
df
MS
-------------+-----------------------------Model | .482427232
6 .080404539
Residual |
.45226629
8 .056533286
-------------+-----------------------------Total | .934693521
14 .066763823
Number of obs
F( 6,
8)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
15
1.42
0.3140
0.5161
0.1532
.23777
-----------------------------------------------------------------------------wage |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------educ |
.0258221
.0446859
0.58
0.579
-.0772238
.1288681
exp |
.1033913
.0473454
2.18
0.061
-.0057875
.21257
ability |
.0307435
.1212013
0.25
0.806
-.2487472
.3102343
mothered |
.1016307
.070175
1.45
0.186
-.0601932
.2634546
fathered |
.0016443
.0446491
0.04
0.972
-.1013167
.1046054
sibs |
.0591692
.069018
0.86
0.416
-.0999866
.218325
_cons |
.0489959
.9488077
0.05
0.960
-2.138959
2.23695
-----------------------------------------------------------------------------.
.
.
.
.
ECONOMETRIA I
. regress wage $x1
Source |
SS
df
MS
-------------+-----------------------------Model | .171377058
3 .057125686
Residual | .763316463
11 .069392406
-------------+-----------------------------Total | .934693521
14 .066763823
Number of obs
F( 3,
11)
Prob > F
R-squared
Adj R-squared
Root MSE
=
15
=
0.82
= 0.5080
= 0.1834
= -0.0394
= .26342
-----------------------------------------------------------------------------wage |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------educ |
.014539
.0490215
0.30
0.772
-.0933566
.1224346
exp |
.07103
.0480342
1.48
0.167
-.0346924
.1767525
ability |
.0266154
.0991173
0.27
0.793
-.1915404
.2447711
_cons |
1.66364
.6185532
2.69
0.021
.3022133
3.025066
-----------------------------------------------------------------------------.
. *b)Regresso de Y sobre X1 e X2
. regress wage $x1 $x2
Source |
SS
df
MS
-------------+-----------------------------Model | .482427232
6 .080404539
Residual |
.45226629
8 .056533286
-------------+-----------------------------Total | .934693521
14 .066763823
Number of obs
F( 6,
8)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
15
1.42
0.3140
0.5161
0.1532
.23777
-----------------------------------------------------------------------------wage |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------educ |
.0258221
.0446859
0.58
0.579
-.0772238
.1288681
exp |
.1033913
.0473454
2.18
0.061
-.0057875
.21257
ability |
.0307435
.1212013
0.25
0.806
-.2487472
.3102343
mothered |
.1016307
.070175
1.45
0.186
-.0601932
.2634546
fathered |
.0016443
.0446491
0.04
0.972
-.1013167
.1046054
sibs |
.0591692
.069018
0.86
0.416
-.0999866
.218325
_cons |
.0489959
.9488077
0.05
0.960
-2.138959
2.23695
-----------------------------------------------------------------------------. *c)Regresso de cada varivel x2 sobre as variveis x1
. regress mothered $x1
Source |
SS
df
MS
-------------+-----------------------------Model | 6.55275053
3 2.18425018
Residual | 18.3805828
11 1.67096207
-------------+-----------------------------Total | 24.9333333
14 1.78095238
Number of obs
F( 3,
11)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
15
1.31
0.3211
0.2628
0.0618
1.2927
-----------------------------------------------------------------------------mothered |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------educ | -.0837141
.2405547
-0.35
0.734
-.6131716
.4457433
exp | -.2859633
.2357097
-1.21
0.250
-.8047569
.2328303
ability |
.5028718
.4863813
1.03
0.323
-.5676462
1.57339
_cons |
13.76043
3.03532
4.53
0.001
7.079742
20.44113
-----------------------------------------------------------------------------. regress fathered $x1
Source |
SS
df
MS
-------------+-----------------------------Model | 7.32880185
3 2.44293395
Residual | 40.0045315
11 3.63677559
-------------+-----------------------------Total | 47.3333333
14 3.38095238
Number of obs
F( 3,
11)
Prob > F
R-squared
Adj R-squared
Root MSE
=
15
=
0.67
= 0.5870
= 0.1548
= -0.0757
=
1.907
-----------------------------------------------------------------------------fathered |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------educ |
.0267585
.354886
0.08
0.941
-.7543403
.8078573
exp |
.0011246
.3477382
0.00
0.997
-.7642422
.7664913
ability |
.8727106
.7175494
1.22
0.249
-.706605
2.452026
_cons |
11.99981
4.477951
2.68
0.021
2.143909
21.85572
ECONOMETRIA I
-----------------------------------------------------------------------------. regress sibs $x1
Source |
SS
df
MS
-------------+-----------------------------Model | 8.59734061
3
2.8657802
Residual | 13.8026594
11 1.25478722
-------------+-----------------------------Total |
22.4
14
1.6
Number of obs
F( 3,
11)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
15
2.28
0.1357
0.3838
0.2158
1.1202
-----------------------------------------------------------------------------sibs |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------educ | -.0476471
.2084566
-0.23
0.823
-.506457
.4111628
exp | -.0557793
.2042581
-0.27
0.790
-.5053484
.3937897
ability | -.9577689
.4214816
-2.27
0.044
-1.885444
-.0300942
_cons |
3.319784
2.630305
1.26
0.233
-2.469479
9.109047
-----------------------------------------------------------------------------end of do-file
ECONOMETRIA I
.
. *Criando a variavel binaria = 1 se o individuo ter filho menor de 18 anos
. gen kids=1 if kl6>0 | k618>0
(229 missing values generated)
. replace kids=0 if kids==.
(229 real changes made)
.
. *Criando a variavel idade ao quadrado.
. gen wa2=wa^2
.
. *Arrumando o "label" das variaveis criadas
. label variable earn "earnings = whrs* ww"
. label variable lnearn "ln earnings"
. label variable kids "dummy variable = 1 there are children under 18 in the
household"
. label variable wa2 "wifes age squared"
.
. *Rodando o modelo
. regress lnearn wa wa2 we kids
Source |
SS
df
MS
-------------+-----------------------------Model | 25.6254667
4 6.40636666
Residual | 599.458161
423 1.41715877
-------------+-----------------------------Total | 625.083628
427 1.46389608
Number of obs
F( 4,
423)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
428
4.52
0.0014
0.0410
0.0319
1.1904
-----------------------------------------------------------------------------lnearn |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------wa |
.2005573
.0838603
2.39
0.017
.0357226
.365392
wa2 | -.0023147
.0009869
-2.35
0.019
-.0042545
-.0003749
we |
.0674727
.0252486
2.67
0.008
.0178444
.117101
kids | -.3511953
.1475326
-2.38
0.018
-.6411836
-.061207
_cons |
3.240096
1.76743
1.83
0.067
-.2339424
6.714135
-----------------------------------------------------------------------------.
. *Matriz de varincia-covarincia-estimada (vce)
. estat vce
Covariance matrix of coefficients of regress model
e(V) |
wa
wa2
we
kids
_cons
-------------+-----------------------------------------------------------wa | .00703254
wa2 | -.00008232
9.739e-07
we | .00005085 -4.976e-07
.00063749
kids | -.0026412
.00003841 -.00005462
.02176587
_cons | -.14409007
.00166174 -.00926092
.02674867
3.1238075
.
end of do-file
10
ECONOMETRIA I
= 1.234.
label
label
label
label
label
label
label
label
label
variable
variable
variable
variable
variable
variable
variable
variable
variable
g "gasexp/(pop*gasp)"
lng "ln g"
pg "ln gasp "
incomepop "income/pop"
lnincomepop "ln income"
gpop "gasexp/pop"
lngpo "ln gpop"
lnpnc "ln pnc"
lnpuc "ln puc"
. *regresso
. regress lng pg lnincomepop lnpnc lnpuc
Source |
SS
df
MS
-------------+-----------------------------Model | 2.78770665
4 .696926662
Residual | .120870673
47 .002571716
-------------+-----------------------------Total | 2.90857732
51 .057030928
Number of obs
F( 4,
47)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
52
271.00
0.0000
0.9584
0.9549
.05071
-----------------------------------------------------------------------------lng |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------pg | -.0212072
.0437697
-0.48
0.630
-.1092604
.0668461
lnincomepop |
1.095874
.077709
14.10
0.000
.9395438
1.252205
lnpnc | -.3736126
.1570719
-2.38
0.021
-.6896006
-.0576247
11
ECONOMETRIA I
lnpuc |
.0200343
.1033047
0.19
0.847
-.187788
.2278566
_cons | -21.21109
.7532228
-28.16
0.000
-22.72638
-19.69581
-----------------------------------------------------------------------------.
end of do-file
= 4.521,
que bem maior que o valor critico para 95% de confiana de 2.37. Ns
conclumos que os dados so inconsistentes com a hiptese que todas as inclinaes na
equao de rendimentos so iguais a zero.
Ns poderamos ter esperado o resultado obtido, dado as substanciais
estatsticas t achadas anteriormente. Mas esse caso no sempre necessariamente verdadeiro.
Exemplos podem ser achados onde os coeficientes individualmente so estatisticamente
significativos, enquanto que conjuntamente no o so. Este caso pode ser considerado
patolgico, porm o oposto, quando nenhum dos coeficientes significativamente diferente
de zero enquanto o R2 altamente significativo, relativamente comum. O problema que a
interao entre as variveis pode obscurecer as suas contribuies individuais para o modelo,
porm seu efeito conjunto pode ainda ser significativo.
. test wa wa2 we kids
(
(
(
(
1)
2)
3)
4)
wa = 0
wa2 = 0
we = 0
kids = 0
F(
4,
423) =
Prob > F =
4.52
0.0014
12
ECONOMETRIA I
Number of obs
F( 6,
9)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
16
330.29
0.0000
0.9955
0.9925
304.85
-----------------------------------------------------------------------------y |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------x1 |
1.506187
8.491493
0.18
0.863
-17.7029
20.71528
x2 | -.0358192
.033491
-1.07
0.313
-.1115811
.0399427
13
ECONOMETRIA I
x3 |
-2.02023
.4883997
-4.14
0.003
-3.125067
-.915393
x4 | -1.033227
.2142742
-4.82
0.001
-1.517949
-.548505
x5 | -.0511041
.2260732
-0.23
0.826
-.5625172
.460309
x6 |
1829.151
455.4785
4.02
0.003
798.7875
2859.515
_cons |
77270.12
22506.71
3.43
0.007
26356.41
128183.8
-----------------------------------------------------------------------------.
. *Correlao
. correlate x1 x2 x3 x4 x5 x6
(obs=16)
|
x1
x2
x3
x4
x5
x6
-------------+-----------------------------------------------------x1 |
1.0000
x2 |
0.9916
1.0000
x3 |
0.6206
0.6043
1.0000
x4 |
0.4647
0.4464 -0.1774
1.0000
x5 |
0.9792
0.9911
0.6866
0.3644
1.0000
x6 |
0.9911
0.9953
0.6683
0.4172
0.9940
1.0000
.
. *Regresses parciais
. regress x1 x2 x3 x4 x5 x6
Source |
SS
df
MS
-------------+-----------------------------Model | 173397.547
5 34679.5095
Residual | 1288.89024
10 128.889024
-------------+-----------------------------Total | 174686.438
15 11645.7625
Number of obs
F( 5,
10)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
16
269.06
0.0000
0.9926
0.9889
11.353
-----------------------------------------------------------------------------x1 |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------x2 |
.0025613
.0009484
2.70
0.022
.0004481
.0046746
x3 |
.0319216
.0151299
2.11
0.061
-.00179
.0656331
x4 |
.008802
.0074785
1.18
0.266
-.0078611
.0254651
x5 | -.0175496
.006331
-2.77
0.020
-.0316561
-.0034432
x6 | -9.992189
16.66535
-0.60
0.562
-47.12491
27.14054
_cons |
2044.583
533.3698
3.83
0.003
856.1613
3233.005
-----------------------------------------------------------------------------. regress x2 x1 x3 x4 x5 x6
Source |
SS
df
MS
-------------+-----------------------------Model | 1.4811e+11
5 2.9621e+10
Residual | 82856688.7
10 8285668.87
-------------+-----------------------------Total | 1.4819e+11
15 9.8794e+09
Number of obs
F( 5,
10)
Prob > F
R-squared
Adj R-squared
Root MSE
=
16
= 3575.03
= 0.0000
= 0.9994
= 0.9992
= 2878.5
-----------------------------------------------------------------------------x2 |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------x1 |
164.6571
60.96993
2.70
0.022
28.80766
300.5066
x3 |
-13.7898
1.500185
-9.19
0.000
-17.13242
-10.44718
x4 | -2.998116
1.787322
-1.68
0.124
-6.980518
.9842857
x5 |
5.62436
1.180367
4.76
0.001
2.994339
8.254381
x6 |
10902.88
2570.756
4.24
0.002
5174.877
16630.88
_cons |
-480986
148413.8
-3.24
0.009
-811672.6
-150299.5
-----------------------------------------------------------------------------. regress x3 x1 x2 x4 x5 x6
Source |
SS
df
MS
-------------+-----------------------------Model | 12708738.6
5 2541747.72
Residual |
389612.84
10
38961.284
-------------+-----------------------------Total | 13098351.4
15 873223.429
Number of obs
F( 5,
10)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
16
65.24
0.0000
0.9703
0.9554
197.39
-----------------------------------------------------------------------------x3 |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+----------------------------------------------------------------
14
ECONOMETRIA I
x1 |
9.649428
4.573555
2.11
0.061
-.5410873
19.83994
x2 | -.0648431
.0070542
-9.19
0.000
-.0805609
-.0491253
x4 | -.2713815
.1090108
-2.49
0.032
-.5142727
-.0284903
x5 |
.350986
.0954316
3.68
0.004
.138351
.5636209
x6 |
768.5517
167.0507
4.60
0.001
396.3396
1140.764
_cons | -28518.24
11446.89
-2.49
0.032
-54023.49
-3012.989
-----------------------------------------------------------------------------. regress x4 x1 x2 x3 x5 x6
Source |
SS
df
MS
-------------+-----------------------------Model | 5240403.53
5 1048080.71
Residual | 2024157.91
10 202415.791
-------------+-----------------------------Total | 7264561.44
15 484304.096
Number of obs
F( 5,
10)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
16
5.18
0.0133
0.7214
0.5820
449.91
-----------------------------------------------------------------------------x4 |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------x1 |
13.82322
11.74472
1.18
0.266
-12.34565
39.99208
x2 | -.0732429
.0436636
-1.68
0.124
-.1705314
.0240457
x3 |
-1.40991
.5663444
-2.49
0.032
-2.671804
-.1480157
x5 |
.1993171
.3276332
0.61
0.557
-.5306952
.9293294
x6 |
1167.779
561.677
2.08
0.064
-83.71492
2419.274
_cons | -11881.24
33002.42
-0.36
0.726
-85415.22
61652.74
-----------------------------------------------------------------------------. regress x5 x1 x2 x3 x4 x6
Source |
SS
df
MS
-------------+-----------------------------Model |
723991849
5
144798370
Residual | 1818385.01
10 181838.501
-------------+-----------------------------Total |
725810234
15 48387348.9
Number of obs
F( 5,
10)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
16
796.30
0.0000
0.9975
0.9962
426.43
-----------------------------------------------------------------------------x5 |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------x1 | -24.75928
8.931925
-2.77
0.020
-44.66084
-4.857707
x2 |
.123433
.0259045
4.76
0.001
.0657142
.1811519
x3 |
1.638107
.4453946
3.68
0.004
.6457062
2.630508
x4 |
.1790548
.2943265
0.61
0.557
-.4767455
.8348551
x6 | -782.0409
587.1614
-1.33
0.212
-2090.318
526.2363
_cons |
95694.37
8682.033
11.02
0.000
76349.59
115039.1
-----------------------------------------------------------------------------. regress x6 x1 x2 x3 x4 x5
Source |
SS
df
MS
-------------+-----------------------------Model | 339.552031
5 67.9104061
Residual | .447969291
10 .044796929
-------------+-----------------------------Total |
340
15 22.6666667
Number of obs
F( 5,
10)
Prob > F
R-squared
Adj R-squared
Root MSE
=
16
= 1515.96
= 0.0000
= 0.9987
= 0.9980
= .21165
-----------------------------------------------------------------------------x6 |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------x1 | -.0034729
.0057922
-0.60
0.562
-.0163788
.009433
x2 |
.0000589
.0000139
4.24
0.002
.000028
.0000899
x3 |
.0008837
.0001921
4.60
0.001
.0004557
.0013116
x4 |
.0002584
.0001243
2.08
0.064
-.0000185
.0005354
x5 | -.0001927
.0001447
-1.33
0.212
-.000515
.0001296
_cons |
8.305049
15.40358
0.54
0.602
-26.01627
42.62636
-----------------------------------------------------------------------------.
. *Criando varivel
. generate RGNP = x2/x1
.
. *Arrumando o "label" da variavel criada
15
ECONOMETRIA I
. label var RGNP "PNB, em termos reais (x2/x1)"
.
. *Regressao
. regress
y RGNP x4 x5
Source |
SS
df
MS
-------------+-----------------------------Model |
181568361
3 60522787.1
Residual |
3440464.6
12 286705.383
-------------+-----------------------------Total |
185008826
15 12333921.7
Number of obs
F( 3,
12)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
16
211.10
0.0000
0.9814
0.9768
535.45
-----------------------------------------------------------------------------y |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------RGNP |
97.36499
17.91551
5.43
0.000
58.33046
136.3995
x4 | -.6879658
.3222373
-2.13
0.054
-1.390061
.0141289
x5 | -.2995369
.1417612
-2.11
0.056
-.608408
.0093342
_cons |
65720.39
10624.8
6.19
0.000
42570.94
88869.85
-----------------------------------------------------------------------------.
.
.
end of do-file
5.74174].
. *O Exercicio 8 usa a base de dados F22
. use F22.dta, clear
.
. *Criando variveis
. range t 1 52 52
. tsset t
16
ECONOMETRIA I
time variable:
delta:
t, 1 to 52
1 unit
. gen g=gasexp/(pop*gasp)
. gen lng= ln(g)
. gen pg= ln(gasp)
. gen incomepop = income/pop
. gen lnincomepop= ln(income)
. gen lnpnc= ln(pnc)
. gen lnpuc= ln(puc)
. gen gpop= gasexp/pop
. gen lngpo= ln(gpop)
. gen defg=l.lng
(1 missing value generated)
. *Arrumando o "label" das variaveis criadas
.
.
.
.
.
.
.
.
.
.
.
label
label
label
label
label
label
label
label
label
label
label
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
t "tendencia"
g "gasexp/(pop*gasp)"
lng "ln g"
pg "ln gasp "
incomepop "income/pop"
lnincomepop "ln income"
gpop "gasexp/pop"
lngpo "ln gpop"
lnpnc "ln pnc"
lnpuc "ln puc"
defg "(G/pop)t-1"
Number of obs
F( 5,
45)
Prob > F
R-squared
Adj R-squared
Root MSE
=
51
= 1830.77
= 0.0000
= 0.9951
= 0.9946
= .01682
-----------------------------------------------------------------------------lng |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------pg | -.0695317
.0147326
-4.72
0.000
-.0992047
-.0398587
lnincomepop |
.1640462
.0550263
2.98
0.005
.0532175
.2748748
lnpuc |
.1270093
.0357704
3.55
0.001
.054964
.1990546
lnpnc | -.1783946
.0551726
-3.23
0.002
-.2895179
-.0672714
defg |
.8309713
.0457633
18.16
0.000
.7387994
.9231433
_cons |
-3.12318
.9958266
-3.14
0.003
-5.128878
-1.117483
-----------------------------------------------------------------------------.
. estat vce
Covariance matrix of coefficients of regress model
e(V) |
pg lnincome~p
lnpuc
lnpnc
defg
_cons
-------------+-----------------------------------------------------------------------pg | .00021705
lnincomepop | .00001622
.00302789
lnpuc | -.00004055 -.00060623
.00127952
lnpnc | -.00021705 -.00024708 -.00167822
.00304401
defg | -.0001109 -.00218807
.0000857
.00068115
.00209428
_cons | -.00120876 -.05260159
.00916719
.00510155
.04391455
.99167066
.
.
end of do-file
17
ECONOMETRIA I
0,0058746 puc + 0,0069073 ppt + 0,0012289 pd + 0,0126905 pn
0,0280278 ps + 0,0725037 t
Os sinais esto dentro das expectativas da Teoria Econmica. Um aumento na
renda per capita tende aumentar G; pois, os indivduos tendem a gastar a renda excedente.
Uma queda no preo da gasolina tende a aumentar G, equivale a um aumento da renda. Um
aumento no preo dos carros novos tende a aumentar G; pois, aumenta o consumo agregado.
Se cair o preo do carro usado G tende a aumentar; pois, camadas da populao que antes no
tinham acesso a carros, agora passam a ter. Um aumento no preo do transporte pblico tende
aumentar G; pois, uma parcela de usurios troca o transporte pblico por carros, prprio ou
adquirem um (novo ou usado). Um aumento do preo agregado nos bens durveis e bens nodurveis tende aumentar G; pois, um aumento geral nos preos gerais implica em aumento de
custos, inclusive nos custos de produo de G. Uma queda no preo agregado dos servios
tendem aumentar G; pois, um aumento da demanda por servios pode gerar um aumento na
demanda por G. Um aumento em t (passagem do tempo) G aumenta.
. *O Exercicio 9 usa a base de dados F22
. use F22.dta, clear
.
. *criar a varivel g
. generate g = 1000000* gasexp/( gasp* pop)
.
. *criar variavel temporal
. generate t = year - 1952
.
. *a) Regresso
. regress g income gasp pnc puc ppt pd pn ps t
Source |
SS
df
MS
-------------+-----------------------------Model | 56.7083042
9 6.30092268
Residual |
.49854905
42 .011870215
-------------+-----------------------------Total | 57.2068532
51
1.121703
Number of obs
F( 9,
42)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
52
530.82
0.0000
0.9913
0.9894
.10895
-----------------------------------------------------------------------------g |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------income |
.0002157
.0000518
4.17
0.000
.0001113
.0003202
gasp | -.0110838
.0039781
-2.79
0.008
-.019112
-.0030557
pnc |
.0005774
.0128441
0.04
0.964
-.0253432
.0264979
puc | -.0058746
.0048703
-1.21
0.234
-.0157033
.0039541
ppt |
.0069073
.0048361
1.43
0.161
-.0028524
.016667
pd |
.0012289
.0118818
0.10
0.918
-.0227495
.0252072
pn |
.0126905
.012598
1.01
0.320
-.0127333
.0381142
ps | -.0280278
.0079962
-3.51
0.001
-.0441649
-.0118907
t |
.0725037
.0141828
5.11
0.000
.0438816
.1011257
_cons |
1.105878
.5693784
1.94
0.059
-.0431744
2.25493
-----------------------------------------------------------------------------. matrix list e(b)
e(b)[1,10]
income
gasp
ps
t
y1
.00021575 -.01108384
.0280278
.07250369
y1
pnc
puc
ppt
pd
pn
.00057737
-.00587463
.00690727
.00122886
.01269047
_cons
1.1058778
.
. *b) b4 - b5 = 0
. lincom pnc-puc
18
ECONOMETRIA I
( 1)
pnc - puc = 0
-----------------------------------------------------------------------------g |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------(1) |
.006452
.0130374
0.49
0.623
-.0198585
.0327625
-----------------------------------------------------------------------------.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
lng = ln(g)
lnincome = ln(income)
lngasp = ln(gasp)
lnpnc = ln(pnc)
lnpuc = ln(puc)
lnppt = ln(ppt)
lnpd = ln(pd)
lnpn = ln(pn)
lnps = ln(ps)
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
regress lng lnincome lngasp lnpnc lnpuc lnppt lnpd lnpn lnps t
Source |
SS
df
MS
-------------+-----------------------------Model | 2.87044868
9 .318938742
Residual | .038128217
42 .000907815
-------------+-----------------------------Total |
2.9085769
51
.05703092
Number of obs
F( 9,
42)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
52
351.33
0.0000
0.9869
0.9841
.03013
-----------------------------------------------------------------------------lng |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnincome |
.9929907
.2503763
3.97
0.000
.4877109
1.49827
lngasp |
.0605177
.0540101
1.12
0.269
-.0484792
.1695146
lnpnc | -.1547138
.2669637
-0.58
0.565
-.6934683
.3840408
lnpuc | -.4890899
.0851996
-5.74
0.000
-.6610297
-.31715
lnppt |
.0192726
.136449
0.14
0.888
-.2560926
.2946378
lnpd |
1.732055
.2598871
6.66
0.000
1.207582
2.256529
lnpn | -.7295301
.2650689
-2.75
0.009
-1.264461
-.1945995
lnps | -.8679929
.3529119
-2.46
0.018
-1.580198
-.1557878
t |
.0379721
.0075137
5.05
0.000
.0228088
.0531354
_cons | -7.287192
2.520568
-2.89
0.006
-12.37391
-2.200479
-----------------------------------------------------------------------------.
. *Anlise do fator de inflao (VIF) com as variveis
. *originais e aps obter a logaritma
.
. quietly regress g income gasp pnc puc ppt pd pn ps t
. estat vif
Variable |
VIF
1/VIF
-------------+---------------------pn |
1614.88
0.000619
ps |
1229.94
0.000813
19
ECONOMETRIA I
pnc |
974.93
0.001026
pd |
820.65
0.001219
ppt |
481.06
0.002079
income |
354.84
0.002818
puc |
265.78
0.003762
t |
198.49
0.005038
gasp |
64.62
0.015476
-------------+---------------------Mean VIF |
667.24
.
. quietly regress lng lnincome lngasp lnpnc lnpuc lnppt lnpd lnpn lnps t
. estat vif
Variable |
VIF
1/VIF
-------------+---------------------lnps |
4992.04
0.000200
lnpn |
1616.82
0.000618
lnpd |
981.54
0.001019
lnppt |
816.07
0.001225
lnpnc |
763.93
0.001309
t |
728.42
0.001373
lnincome |
427.95
0.002337
lnpuc |
221.66
0.004511
lngasp |
75.55
0.013236
-------------+---------------------Mean VIF |
1180.44
.
.
+[
20
ECONOMETRIA I
+[
. *criao de variveis
.
.
.
.
.
.
.
.
generate
generate
generate
generate
generate
generate
lncost = ln(cost)
lnq = ln(q)
hlnq2 = 0.5*lnq*lnq
lnpk = ln(pk)
lnpl = ln(pl)
lnpf = ln(pf)
Number of obs
F( 4,
118)
Prob > F
R-squared
Adj R-squared
Root MSE
=
123
= 1817.84
= 0.0000
= 0.9840
= 0.9835
= .20076
-----------------------------------------------------------------------------lncost |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------hlnq2 |
.1159011
.0014216
81.53
0.000
.113086
.1187163
lnpk | -.0259452
.12603
-0.21
0.837
-.2755189
.2236286
lnpl |
.3789541
.1226855
3.09
0.003
.1360035
.6219048
lnpf |
.6241747
.0699078
8.93
0.000
.4857382
.7626113
_cons | -6.467459
1.219985
-5.30
0.000
-8.883361
-4.051558
-----------------------------------------------------------------------------.
. *matriz de varincia-covarincia
. estat vce
Covariance matrix of coefficients of regress model
e(V) |
hlnq2
lnpk
lnpl
lnpf
_cons
-------------+-----------------------------------------------------------hlnq2 | 2.021e-06
lnpk | -.00002248
.01588356
21
ECONOMETRIA I
lnpl | -.00003157
.00179289
.01505173
lnpf | 1.069e-06 -.00098362 -.00256715
.00488711
_cons | .00030489
-.0799313 -.13292029
.01062797
1.4883623
-------------------------------------------------------------------------. *criao de variveis
.
.
.
.
.
Number of obs
F( 4,
153)
Prob > F
R-squared
Adj R-squared
Root MSE
=
158
= 4879.59
= 0.0000
= 0.9922
= 0.9920
= .13779
-----------------------------------------------------------------------------lncostpf |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnq |
.4027455
.0314831
12.79
0.000
.3405477
.4649432
hlnq2 |
.0608951
.0043253
14.08
0.000
.0523501
.0694402
lnpkpf |
.1620339
.0404056
4.01
0.000
.0822091
.2418587
lnplpf |
.1524447
.0465973
3.27
0.001
.0603874
.244502
_cons | -6.818163
.2524392
-27.01
0.000
-7.31688
-6.319447
-----------------------------------------------------------------------------.
. *matriz de varincia-covarincia
. estat vce
Covariance matrix of coefficients of regress model
e(V) |
lnq
hlnq2
lnpkpf
lnplpf
_cons
-------------+-----------------------------------------------------------lnq | .00099119
hlnq2 | -.00013358
.00001871
lnpkpf | .00010023 -.00001493
.00163261
lnplpf | -.00019957
.00002454 -.00101981
.00217131
_cons | -.00238382
.00031042
.00399459 -.01047129
.06372555
---------------------------------------------------------------------------
. Os resultados
das duas regresses so representados na rotina abaixo. A estatstica F para a hiptese de um modelo
Cobb-Douglas
22
ECONOMETRIA I
O valor crtico da tabela F 3,07, ento ns no devemos rejeitar a hiptese que o modelo
Cobb-Douglas apropriado.
A hiptese dos retornos constantes de escala tambm PE testada nos estudos de produo.
Essa hiptese equivalente para a restrio de que a soma dos dois coeficientes da funo de produo
Cobb-Douglas igual a 1. Para os dados anteriores,
. *criao de variveis
. generate lnvalueadd = ln(valueadd)
. generate lnlabor = ln(labor)
.
.
.
.
generate
generate
generate
generate
lncapital = ln(capital)
hlnlabor2 = 0.5*lnlabor*lnlabor
hlncapital2 = 0.5*lncapital*lncapital
lnlablncap = lnlabor*lncapital
label
label
label
label
label
label
variable
variable
variable
variable
variable
variable
. *Regresso Translog
. regress lnvalueadd
Source |
SS
df
MS
-------------+-----------------------------Model | 14.3832713
5 2.87665426
Residual | .679926211
21 .032377439
-------------+-----------------------------Total | 15.0631975
26
.57935375
Number of obs
F( 5,
21)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
27
88.85
0.0000
0.9549
0.9441
.17994
-----------------------------------------------------------------------------lnvalueadd |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnlabor |
3.61365
1.548071
2.33
0.030
.3942591
6.833041
lncapital |
-1.89312
1.016259
-1.86
0.077
-4.006547
.2203065
23
ECONOMETRIA I
hlnlabor2 | -.9640604
.7073833
-1.36
0.187
-2.435145
.5070238
hlncapital2 |
.0852921
.2926086
0.29
0.774
-.5232209
.693805
lnlablncap |
.3123918
.4389265
0.71
0.484
-.6004058
1.225189
_cons |
.944193
2.910755
0.32
0.749
-5.109053
6.997438
------------------------------------------------------------------------------
e(V) |
lnlabor
lncapital
hlnlabor2 hlncapit~2 lnlablncap
_cons
-------------+-----------------------------------------------------------------------lnlabor | 2.3965251
lncapital | -1.2310116
1.0327828
hlnlabor2 | -.66580101
.52305032
.50039116
hlncapital2 | .03476768
.02636902
.14674241
.0856198
lnlablncap | .18311127 -.22554088 -.28803269 -.11604012
.19265648
_cons | -2.3879085 -.33129048 -.08760035 -.23317457
.36354542
8.4724922
--------------------------------------------------------------------------------------
. *regressao Cobb-Douglas
. regress lnvalueadd
lnlabor lncapital
Source |
SS
df
MS
-------------+-----------------------------Model | 14.2115637
2 7.10578187
Residual |
.85163374
24 .035484739
-------------+-----------------------------Total | 15.0631975
26
.57935375
Number of obs
F( 2,
24)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
27
200.25
0.0000
0.9435
0.9388
.18837
-----------------------------------------------------------------------------lnvalueadd |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnlabor |
.6029994
.125954
4.79
0.000
.3430432
.8629556
lncapital |
.3757102
.085346
4.40
0.000
.1995648
.5518556
_cons |
1.170644
.326782
3.58
0.002
.4961988
1.845089
------------------------------------------------------------------------------
24
ECONOMETRIA I
e(V) |
lnlabor
lncapital
_cons
-------------+-----------------------------------lnlabor |
.0158644
lncapital | -.0096162
.00728393
_cons | -.0198354
.00118885
.1067865
-----------------------------------------------------------------------
generate
generate
generate
generate
generate
generate
generate
generate
generate
lng = ln(g)
lnincome = ln(income)
lngasp = ln(gasp)
lnpnc = ln(pnc)
lnpuc = ln(puc)
lnppt = ln(ppt)
lnpd = ln(pd)
lnpn = ln(pn)
lnps = ln(ps)
.
end of do-file
. do "C:\Users\Lucca\AppData\Local\Temp\STD01000000.tmp"
.
.
.
.
.
.
.
.
.
.
.
label
label
label
label
label
label
label
label
label
label
label
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
25
ECONOMETRIA I
.
end of do-file
. do "C:\Users\Lucca\AppData\Local\Temp\STD01000000.tmp"
. regress lng lnincome lngasp lnpnc lnpuc lnppt lnpd lnpn lnps t
Source |
SS
df
MS
-------------+-----------------------------Model | 2.87044868
9 .318938742
Residual | .038128217
42 .000907815
-------------+-----------------------------Total |
2.9085769
51
.05703092
Number of obs
F( 9,
42)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
52
351.33
0.0000
0.9869
0.9841
.03013
-----------------------------------------------------------------------------lng |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnincome |
.9929907
.2503763
3.97
0.000
.4877109
1.49827
lngasp |
.0605177
.0540101
1.12
0.269
-.0484792
.1695146
lnpnc | -.1547138
.2669637
-0.58
0.565
-.6934683
.3840408
lnpuc | -.4890899
.0851996
-5.74
0.000
-.6610297
-.31715
lnppt |
.0192726
.136449
0.14
0.888
-.2560926
.2946378
lnpd |
1.732055
.2598871
6.66
0.000
1.207582
2.256529
lnpn | -.7295301
.2650689
-2.75
0.009
-1.264461
-.1945995
lnps | -.8679929
.3529119
-2.46
0.018
-1.580198
-.1557878
t |
.0379721
.0075137
5.05
0.000
.0228088
.0531354
_cons | -7.287192
2.520568
-2.89
0.006
-12.37391
-2.200479
-----------------------------------------------------------------------------. gen r1 = 0.9869
.
.
end of do-file
. do "C:\Users\Lucca\AppData\Local\Temp\STD01000000.tmp"
. *Regresso mltipla excluindo as variveis de preo agregado - para obter R2:
. regress lng lnincome lngasp lnpnc lnpuc lnppt t
Source |
SS
df
MS
-------------+-----------------------------Model | 2.80714027
6 .467856712
Residual | .101436623
45 .002254147
-------------+-----------------------------Total |
2.9085769
51
.05703092
Number of obs
F( 6,
45)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
52
207.55
0.0000
0.9651
0.9605
.04748
-----------------------------------------------------------------------------lng |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------lnincome |
1.649092
.2026545
8.14
0.000
1.240925
2.057259
lngasp | -.0537336
.042511
-1.26
0.213
-.1393551
.0318879
lnpnc | -.0319892
.2057429
-0.16
0.877
-.4463767
.3823984
lnpuc | -.0739298
.1054897
-0.70
0.487
-.286397
.1385374
lnppt | -.0615358
.1234373
-0.50
0.621
-.3101513
.1870796
t | -.0128761
.0052534
-2.45
0.018
-.023457
-.0022952
_cons | -13.13966
2.09171
-6.28
0.000
-17.35258
-8.926744
-----------------------------------------------------------------------------. gen r0 = 0.9651
.
. *teste considerando R2 encontrados
. gen F=((r1-r0)/2)/((1-r1)/(52-10))
. list r0 r1 F
1.
2.
3.
4.
5.
+--------------------------+
|
r0
r1
F |
|--------------------------|
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
|--------------------------|
26
ECONOMETRIA I
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
|--------------------------|
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
|--------------------------|
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
|--------------------------|
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
|--------------------------|
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
|--------------------------|
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
|--------------------------|
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
|--------------------------|
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
|--------------------------|
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
|--------------------------|
| .9651
.9869
34.94646 |
| .9651
.9869
34.94646 |
+--------------------------+
.
.
end of do-file
13) No cap. 6, refazer o exemplo 6.7, demanda por gasolina (Table F2.2)
27
ECONOMETRIA I
28
ECONOMETRIA I
O valor crtico tabelado 2.449, ento esta hiptese rejeitada. Os dados sugerem
que o modelo para os dois perodos so sistematicamente diferentes, alm de um simples
deslocamento no termo constante.
A razo F destes resultados da estimao do modelo sujeito a restrio que as duas
elasticidades preo dos automveis e o coeficiente de tendencia de tempo so imutveis
. gen g=gasexp/(pop*gasp)
. gen lng= ln(g)
end of do-file
. do "C:\Users\Lucca\AppData\Local\Temp\STD01000000.tmp"
.
.
.
.
.
.
.
gen
gen
gen
gen
gen
gen
gen
pg= ln(gasp)
incomepop = income/pop
lnincomepop= ln(income)
gpop= gasexp/pop
lngpo= ln(gpop)
lnpnc= ln(pnc)
lnpuc= ln(puc)
end of do-file
29
ECONOMETRIA I
. do "C:\Users\Lucca\AppData\Local\Temp\STD01000000.tmp"
.
.
.
.
.
.
.
.
.
.
end of do-file
. do "C:\Users\Lucca\AppData\Local\Temp\STD01000000.tmp"
. gen t= _n
. regress lng pg lnincomepop lnpnc lnpuc t
Source |
SS
df
MS
-------------+-----------------------------Model | 2.80658066
5 .561316133
Residual | .101996656
46 .002217319
-------------+-----------------------------Total | 2.90857732
51 .057030928
Number of obs
F( 5,
46)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
52
253.15
0.0000
0.9649
0.9611
.04709
-----------------------------------------------------------------------------lng |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------pg | -.0539223
.0421606
-1.28
0.207
-.1387871
.0309426
lnincomepop |
1.624962
.1951747
8.33
0.000
1.232096
2.017828
lnpnc | -.0834322
.1765335
-0.47
0.639
-.4387756
.2719112
lnpuc | -.0846749
.1024172
-0.83
0.413
-.29083
.1214801
t | -.0139261
.0047732
-2.92
0.005
-.0235341
-.0043181
_cons | -26.67868
2.000292
-13.34
0.000
-30.70506
-22.6523
-----------------------------------------------------------------------------.
.
end of do-file
. do "C:\Users\Lucca\AppData\Local\Temp\STD01000000.tmp"
. *regresso 1953 a 1973
.
. regress lng pg lnincomepop lnpnc lnpuc t if year<1974
Source |
SS
df
MS
-------------+-----------------------------Model | .798213665
5 .159642733
Residual | .002022414
15 .000134828
-------------+-----------------------------Total | .800236078
20 .040011804
Number of obs
F( 5,
15)
Prob > F
R-squared
Adj R-squared
Root MSE
=
21
= 1184.05
= 0.0000
= 0.9975
= 0.9966
= .01161
-----------------------------------------------------------------------------lng |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------pg | -.0322579
.1579237
-0.20
0.841
-.3688644
.3043486
lnincomepop |
.8481922
.1158819
7.32
0.000
.6011958
1.095189
lnpnc |
.6987538
.1184026
5.90
0.000
.4463846
.951123
lnpuc | -.2905282
.0538216
-5.40
0.000
-.4052463
-.1758102
t |
.0100634
.0027363
3.68
0.002
.0042311
.0158957
_cons | -22.16467
1.054708
-21.01
0.000
-24.41272
-19.91661
-----------------------------------------------------------------------------.
. *regresso 1974 a 2004
.
. regress lng pg lnincomepop lnpnc lnpuc t if year>1973
Source |
SS
df
MS
-------------+-----------------------------Model | .144173775
5 .028834755
Residual | .007127823
25 .000285113
Number of obs =
F( 5,
25) =
Prob > F
=
R-squared
=
31
101.13
0.0000
0.9529
30
ECONOMETRIA I
-------------+-----------------------------Total | .151301598
30 .005043387
Adj R-squared =
Root MSE
=
0.9435
.01689
-----------------------------------------------------------------------------lng |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------pg | -.1240219
.0185093
-6.70
0.000
-.1621424
-.0859013
lnincomepop |
.3738983
.1490876
2.51
0.019
.0668467
.6809499
lnpnc | -.0011458
.0841047
-0.01
0.989
-.1743628
.1720711
lnpuc | -.0216715
.0475906
-0.46
0.653
-.1196862
.0763432
t |
.0044919
.0029221
1.54
0.137
-.0015263
.0105101
_cons |
-15.3283
1.415023
-10.83
0.000
-18.24259
-12.414
-----------------------------------------------------------------------------.
. *regresso excluindo os anos 1974, 1975, 1980 e 1981
. gen schok=0
. gen schok1=0
. gen schok2=0
. gen schok3=0
.
. regress lng pg lnincomepop lnpnc lnpuc t schok schok1 schok2 schok3
note: schok omitted because of collinearity
note: schok1 omitted because of collinearity
note: schok2 omitted because of collinearity
note: schok3 omitted because of collinearity
Source |
SS
df
MS
-------------+-----------------------------Model | 2.80658066
5 .561316133
Residual | .101996656
46 .002217319
-------------+-----------------------------Total | 2.90857732
51 .057030928
Number of obs
F( 5,
46)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
52
253.15
0.0000
0.9649
0.9611
.04709
-----------------------------------------------------------------------------lng |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------pg | -.0539223
.0421606
-1.28
0.207
-.1387871
.0309426
lnincomepop |
1.624962
.1951747
8.33
0.000
1.232096
2.017828
lnpnc | -.0834322
.1765335
-0.47
0.639
-.4387756
.2719112
lnpuc | -.0846749
.1024172
-0.83
0.413
-.29083
.1214801
t | -.0139261
.0047732
-2.92
0.005
-.0235341
-.0043181
schok | (omitted)
schok1 | (omitted)
schok2 | (omitted)
schok3 | (omitted)
_cons | -26.67868
2.000292
-13.34
0.000
-30.70506
-22.6523
-----------------------------------------------------------------------------.
. *regresso com dummy 0 no primeiro perodo e 1 no segundo perodo
. gen g2= (year>1973)
. regress lng pg lnincomepop lnpnc lnpuc t g2
Source |
SS
df
MS
-------------+-----------------------------Model | 2.81649573
6 .469415955
Residual | .092081589
45 .002046258
-------------+-----------------------------Total | 2.90857732
51 .057030928
Number of obs
F( 6,
45)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
52
229.40
0.0000
0.9683
0.9641
.04524
-----------------------------------------------------------------------------lng |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------pg | -.1132024
.0486377
-2.33
0.024
-.2111638
-.0152411
lnincomepop |
1.456223
.20256
7.19
0.000
1.048246
1.8642
lnpnc |
-.104403
.1698546
-0.61
0.542
-.4465077
.2377017
lnpuc | -.0864638
.0983906
-0.88
0.384
-.2846327
.111705
t | -.0092319
.005057
-1.83
0.075
-.0194173
.0009535
g2 |
.084167
.0382362
2.20
0.033
.0071554
.1611786
_cons | -24.90091
2.084405
-11.95
0.000
-29.09911
-20.7027
31
ECONOMETRIA I
-----------------------------------------------------------------------------.
. *regresso com dummy 1 no primeiro perodo e 0 no segundo perodo
. gen g3=(year<1974)
.
. regress lng pg lnincomepop lnpnc lnpuc t g3
Source |
SS
df
MS
-------------+-----------------------------Model | 2.81649573
6 .469415955
Residual | .092081589
45 .002046258
-------------+-----------------------------Total | 2.90857732
51 .057030928
Number of obs
F( 6,
45)
Prob > F
R-squared
Adj R-squared
Root MSE
=
=
=
=
=
=
52
229.40
0.0000
0.9683
0.9641
.04524
-----------------------------------------------------------------------------lng |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------pg | -.1132024
.0486377
-2.33
0.024
-.2111638
-.0152411
lnincomepop |
1.456223
.20256
7.19
0.000
1.048246
1.8642
lnpnc |
-.104403
.1698546
-0.61
0.542
-.4465077
.2377017
lnpuc | -.0864638
.0983906
-0.88
0.384
-.2846327
.111705
t | -.0092319
.005057
-1.83
0.075
-.0194173
.0009535
g3 |
-.084167
.0382362
-2.20
0.033
-.1611786
-.0071554
_cons | -24.81674
2.099516
-11.82
0.000
-29.04538
-20.5881
-----------------------------------------------------------------------------.
end of do-file
.