Trabajo 2 Econometria

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Wednesday May 22 12:49:20 2024 Page 1

___ ____ ____ ____ ____(R)


/__ / ____/ / ____/
___/ / /___/ / /___/
Statistics/Data Analysis

User: taller de econometria no enviable

___ ____ ____ ____ ____ (R)


/__ / ____/ / ____/
___/ / /___/ / /___/ 14.0 Copyright 1985-2015 StataCorp LP
Statistics/Data Analysis StataCorp
4905 Lakeway Drive
MP - Parallel Edition College Station, Texas 77845 USA
800-STATA-PC http://www.stata.com
979-696-4600 stata@stata.com
979-696-4601 (fax)

Single-user 8-core Stata perpetual license:


Serial number: 10699393
Licensed to: Lina Mendoza
仅供学习

Notes:
1. Unicode is supported; see help unicode_advice.
2. More than 2 billion observations are allowed; see help obs_advice.
3. Maximum number of variables is set to 5000; see help set_maxvar.
4. New update available; type -update all-

1 . *Se ingresa el do "cloruro_bario,dta".

2 .
3 . use "C:\Users\linam\Downloads\cloruro_bario.dta", clear

4 .
5 . *Se convierten las variables en ln.

6 .
7 . gen lnchnimp= ln( chnimp )

8 .
9 . gen lnchempi= ln( chempi )

10 .
11 . gen lngas= ln( gas )

12 .
13 . gen lnrtwex= ln( rtwex )

14 .
15 . *Utilizamos el comando "summmarize" hallamos el análisis descriptivo que se pide.

16 .
17 . summarize chnimp chempi gas rtwex befile6 affile6 afdec6

Variable Obs Mean Std. Dev. Min Max

chnimp 131 589.237 349.5416 39.683 1794.516


chempi 131 122.8313 14.23508 100.1 159
gas 131 8.52e+09 5.63e+08 6.90e+09 1.02e+10
rtwex 131 102.5048 17.96898 79.45 146.45
befile6 131 .0458015 .2098569 0 1

affile6 131 .0458015 .2098569 0 1


afdec6 131 .0458015 .2098569 0 1

18 .
Wednesday May 22 12:49:20 2024 Page 2

19 . reg lnchnimp lnchempi lngas lnrtwex befile6 affile6 afdec6

Source SS df MS Number of obs = 131


F(6, 124) = 9.06
Model 19.4051607 6 3.23419346 Prob > F = 0.0000
Residual 44.2470875 124 .356831351 R-squared = 0.3049
Adj R-squared = 0.2712
Total 63.6522483 130 .489632679 Root MSE = .59735

lnchnimp Coef. Std. Err. t P>|t| [95% Conf. Interval]

lnchempi 3.117193 .4792021 6.50 0.000 2.168718 4.065668


lngas .1963504 .9066172 0.22 0.829 -1.598099 1.9908
lnrtwex .9830183 .4001537 2.46 0.015 .1910022 1.775034
befile6 .0595739 .2609699 0.23 0.820 -.4569585 .5761064
affile6 -.0324064 .2642973 -0.12 0.903 -.5555249 .490712
afdec6 -.565245 .2858352 -1.98 0.050 -1.130993 .0005028
_cons -17.803 21.04537 -0.85 0.399 -59.45769 23.85169

20 .
21 . * 1) Teniendo en cuenta un alfa del 0.05%, vemos que el valor P (0.820) es mayor a nuestro al
> o existe evidencia estadística para sustentar que las importaciones son altas en el período i

22 .
23 . * 2) Teniendo en cuenta un alfa del 0.05%, vemos que el valor P (0.820) es mayor a nuestro al
> ncia para sustentar un cambio notable en las importaciones después de una demanda antidumping

24 .
25 .
26 .
27 . * 3) Las exportaciones disminuyen en -0.565245 después del fallo.

28 .
29 . * colocamos el año "2017 mes 2" para que el programa nos generé la fecha que vaya acorde al c
> tiempo.

30 .
31 . gen time=tq(2017q2)+_n-1

32 .
33 . format %tmMon_CCYY time

34 .
35 . tsset time, monthly
time variable: time, Feb 1979 to Dec 1989
delta: 1 month

36 .
37 . *Miramos si existe cointegración entre las variables "chnimp" "chempi"

38 .
39 . *Miramos la variable chempi sin diferencia

40 .
41 . tsline chempi

42 .
43 . dfuller chempi,lags(4)

Augmented Dickey-Fuller test for unit root Number of obs = 126

Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value

Z(t) 0.320 -3.501 -2.888 -2.578

MacKinnon approximate p-value for Z(t) = 0.9783


Wednesday May 22 12:49:21 2024 Page 3

44 .
45 . *No es significativo, así que se hace primera diferencia

46 .
47 . tsline d.chempi

48 .
49 . dfuller d.chempi,lags(4)

Augmented Dickey-Fuller test for unit root Number of obs = 125

Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value

Z(t) -4.759 -3.502 -2.888 -2.578

MacKinnon approximate p-value for Z(t) = 0.0001

50 .
51 . *Ahora se mira la "chnimp" sin diferencia

52 .
53 . tsline chnimp

54 .
55 . dfuller chnimp,lags(4)

Augmented Dickey-Fuller test for unit root Number of obs = 126

Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value

Z(t) -3.104 -3.501 -2.888 -2.578

MacKinnon approximate p-value for Z(t) = 0.0263

56 .
57 . *Como la variable "chnimp" ya es menor al alfa sin diferencia y la variable chempi es menor a
> gresión con la primera variable sin diferencia y la segunda con diferencia.

58 .
59 . reg chnimp d.chempi

Source SS df MS Number of obs = 130


F(1, 128) = 2.03
Model 246165.444 1 246165.444 Prob > F = 0.1564
Residual 15500102 128 121094.547 R-squared = 0.0156
Adj R-squared = 0.0079
Total 15746267.5 129 122064.089 Root MSE = 347.99

chnimp Coef. Std. Err. t P>|t| [95% Conf. Interval]

chempi
D1. -25.96247 18.20936 -1.43 0.156 -61.9928 10.06787

_cons 603.8367 31.61587 19.10 0.000 541.2793 666.3941


Wednesday May 22 12:49:21 2024 Page 4

60 .
61 . *eliminamos la constate para ver si mejora el modelo

62 .
63 . reg chnimp d.chempi,noconstant

Source SS df MS Number of obs = 130


F(1, 129) = 3.56
Model 1645184.33 1 1645184.33 Prob > F = 0.0616
Residual 59672751.7 129 462579.471 R-squared = 0.0268
Adj R-squared = 0.0193
Total 61317936.1 130 471676.431 Root MSE = 680.13

chnimp Coef. Std. Err. t P>|t| [95% Conf. Interval]

chempi
D1. 64.79258 34.35668 1.89 0.062 -3.18295 132.7681

64 .
65 . * miranmos los criterios de información

66 .
67 . estat ic

Akaike's information criterion and Bayesian information criterion

Model Obs ll(null) ll(model) df AIC BIC

. 130 . -1031.857 1 2065.715 2068.582

Note: N=Obs used in calculating BIC; see [R] BIC note.

68 .
69 . *creamos los residuales

70 .
71 . predict error,resid
(1 missing value generated)

72 .
73 . tsline error

74 .
75 . dfuller error,lags(4)

Augmented Dickey-Fuller test for unit root Number of obs = 125

Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value

Z(t) -3.595 -3.502 -2.888 -2.578

MacKinnon approximate p-value for Z(t) = 0.0058

76 .
77 . *Viendo que el dfuller del residual es menor a al alfa, podemos evidenciar que hay cointegrac
> o la constante el valor p es mayor al alfa, así que se miramos las variables en ln para ver
Wednesday May 22 12:49:21 2024 Page 5

78 .
79 . dfuller lnchempi,lags(4)

Augmented Dickey-Fuller test for unit root Number of obs = 126

Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value

Z(t) -0.167 -3.501 -2.888 -2.578

MacKinnon approximate p-value for Z(t) = 0.9423

80 .
81 . tsline lnchempi

82 .
83 . *Se mira primera diferencia

84 .
85 . dfuller d.lnchempi,lags(4)

Augmented Dickey-Fuller test for unit root Number of obs = 125

Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value

Z(t) -4.875 -3.502 -2.888 -2.578

MacKinnon approximate p-value for Z(t) = 0.0000

86 .
87 . tsline d.lnchempi

88 .
89 . dfuller lnchnimp,lags(4)

Augmented Dickey-Fuller test for unit root Number of obs = 126

Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value

Z(t) -3.094 -3.501 -2.888 -2.578

MacKinnon approximate p-value for Z(t) = 0.0270

90 .
91 . tsline lnchnimp

92 .
93 . *Se hace la regresión

94 .
95 . reg lnchnimp d.lnchempi

Source SS df MS Number of obs = 130


F(1, 128) = 4.82
Model 2.28764477 1 2.28764477 Prob > F = 0.0299
Residual 60.7532932 128 .474635103 R-squared = 0.0363
Adj R-squared = 0.0288
Total 63.040938 129 .488689442 Root MSE = .68894
Wednesday May 22 12:49:21 2024 Page 6

lnchnimp Coef. Std. Err. t P>|t| [95% Conf. Interval]

lnchempi
D1. -9.289463 4.231324 -2.20 0.030 -17.66186 -.9170663

_cons 6.213656 .0622727 99.78 0.000 6.090439 6.336873

96 .
97 . *Se miran los criterios de información

98 .
99 . estat ic

Akaike's information criterion and Bayesian information criterion

Model Obs ll(null) ll(model) df AIC BIC

. 130 -137.4183 -135.0157 2 274.0313 279.7664

Note: N=Obs used in calculating BIC; see [R] BIC note.

100 .
101 . *se crea el segundo residual

102 .
103 . predict error2,resid
(1 missing value generated)

104 .
105 . tsline error2

106 .
107 . dfuller error2,lags(4)

Augmented Dickey-Fuller test for unit root Number of obs = 125

Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value

Z(t) -3.112 -3.502 -2.888 -2.578

MacKinnon approximate p-value for Z(t) = 0.0257

108 .
109 . *Viendo que el dfuller del residual es menor a al alfa, podemos evidenciar que hay cointegrac
> ración mejoran por mucho respecto al anterior, así que nos quedamos con este modelo.

110 .
111 . predict lnchnimp_estim,xb
(1 missing value generated)

112 .
113 . tsline lnchnimp lnchnimp_estim

114 .
115 . *integrantes: Lina Mendoza, Ivanof Meza y Bryan Consuegra

116 .

You might also like