---- ---------------------------------------- log: C:\datos\docencia\econIccee\practicas2009\chowlog log type: text opened on: 17 Sep 2009, 17:58:52 use "$ruta\chowdta", clear * crear variable logaritmo de 1+ingreso del hogar g ling=ln(1+ing_tot) * crear variable logaritmo de 1+gasto en vivienda del hogar g lviv=ln(1+gvivienda) * crear variable dummy "Montevideo" g Montevideo=(dpto==1) * crear una variable interacción Montevido-Ingreso g lingmvdeo=ling*montevideo *Elasticidad ingreso del gasto en electricidad (Modelo Restringido) reg lviv ling -------------+------------------------------ F( 1, 20770) =2434495 Model 82334231 1 82334231 Prob > F = 00000 Residual 702438039 20770 338198382 R-squared = 05396 -------------+------------------------------ Adj R-squared = 05396 Total 152578035 20771 734572408 Root MSE = 58155 lviv Coef Std Err t P> t [95% Conf Interval] ling 7635228 0048935 15603 0000 7539312 7731144 _cons 407958 0473869 861 0000 315076 5008399 scalar SCR_restrin=e(rss) scalar k=e(df_m)+1 scalar Nobs=e(N) *Elasticidad ingreso del gasto en electricidad Montevideo reg lviv ling if Montevideo==1 Source SS df MS Number of obs = 7178 -------------+------------------------------ F( 1, 7176) =1023552 Model 297604855 1 297604855 Prob > F = 00000 Residual 208647157 7176 290756908 R-squared = 05879 -------------+------------------------------ Adj R-squared = 05878 Total 506252012 7177 705381095 Root MSE = 53922 lviv Coef Std Err t P> t [95% Conf Interval] Página 1
ling 7299952 0072155 10117 0000 7158507 7441396 _cons 1064812 0726767 1465 0000 9223438 1207279 scalar SCR_nrestrin_1=e(rss) *Elasticidad ingreso del gasto en electricidad Montevideo reg lviv ling if Montevideo==0 Source SS df MS Number of obs = 13594 -------------+------------------------------ F( 1, 13592) = 920950 Model 244499857 1 244499857 Prob > F = 00000 Residual 360849385 13592 265486599 R-squared = 04039 -------------+------------------------------ Adj R-squared = 04039 Total 605349242 13593 445338955 Root MSE = 51525 lviv Coef Std Err t P> t [95% Conf Interval] ling 5947658 0061977 9597 0000 5826176 6069141 _cons 1832686 0587044 3122 0000 1717617 1947755 scalar SCR_nrestrin_2=e(rss) * CONTRASTE DE CHOW scalar CHOW1=(SCR_restrin-(SCR_nrestrin_1+SCR_nrestrin_2))/k/((SCR_nrestrin_1+SCR_nrestri n_2)/(nobs-2*k)) scalar p_valor=1-f(k,nobs-2*k,chow1) display p_valor 0 *Elasticidad ingreso del gasto para Montevideo e Interior: *CONTRASTE ESTRUCTURAL DE CHOW UTILIZANDO VARIABLES DUMMY reg lviv Montevideo ling lingmvdeo -------------+------------------------------ F( 3, 20768) =1162436 Model 956283806 3 318761269 Prob > F = 00000 Residual 569496542 20768 274218289 R-squared = 06268 -------------+------------------------------ Adj R-squared = 06267 Total 152578035 20771 734572408 Root MSE = 52366 lviv Coef Std Err t P> t [95% Conf Interval] Montevideo -7678746 0924176-831 0000-9490204 -5867289 ling 5947658 0062988 9443 0000 5824198 6071119 lingmvdeo 1352293 0094221 1435 0000 1167613 1536974 _cons 1832686 059662 3072 0000 1715744 1949628 test Montevideo lingmvdeo ( 1) Montevideo = 0 Página 2
( 2) lingmvdeo = 0 chow[1] F( 2, 20768) = 242401 Prob > F = 00000 *Calcular el estadìstico F del contraste por otra via: Usando (Rbeta_es-r)'{[RVar(beta_es)R']^-1}(Rbeta_es-r)/k *Siendo Var(beta_es) la que se observa a continuación matrix Varcovar=e(V) matrix list Varcovar symmetric Varcovar[4,4] Montevideo ling lingmvdeo _cons Montevideo 00854101 ling 00037473 00003967 lingmvdeo -0008674-00003967 00008878 _cons -00355955-00037473 00037473 00355955 *ESTIMANDO OTRAS ESPECIFICACIONES *Elasticidad ingreso del gasto en electricidad estimando un intercepto diferente para Montevideo e Interior reg lviv Montevideo ling -------------+------------------------------ F( 2, 20769) =1716414 Model 950635185 2 475317593 Prob > F = 00000 Residual 575145163 20769 276924822 R-squared = 06230 -------------+------------------------------ Adj R-squared = 06230 Total 152578035 20771 734572408 Root MSE = 52624 lviv Coef Std Err t P> t [95% Conf Interval] Montevideo 5534025 0081624 6780 0000 5374034 5694015 ling 6552003 0047075 13918 0000 6459733 6644274 _cons 1261873 0446913 2824 0000 1174275 1349472 *Elasticidad ingreso del gasto en electricidad estimando una elasticidad diferente para Montevideo e Interior reg lviv ling lingmvdeo -------------+------------------------------ F( 2, 20769) =1734521 Model 954390732 2 477195366 Prob > F = 00000 Residual 571389616 20769 275116576 R-squared = 06255 -------------+------------------------------ Adj R-squared = 06255 Total 152578035 20771 734572408 Root MSE = 52452 lviv Coef Std Err t P> t [95% Conf Interval] ling 6284557 004828 13017 0000 6189925 6379189 lingmvdeo 0572464 0008295 6902 0000 0556206 0588722 _cons 1512667 0456385 3314 0000 1423212 1602122 Página 3
*TEST DE RAMSEY en modelo no restringido reg lviv Montevideo ling lingmvdeo -------------+------------------------------ F( 3, 20768) =1162436 Model 956283806 3 318761269 Prob > F = 00000 Residual 569496542 20768 274218289 R-squared = 06268 -------------+------------------------------ Adj R-squared = 06267 Total 152578035 20771 734572408 Root MSE = 52366 lviv Coef Std Err t P> t [95% Conf Interval] Montevideo -7678746 0924176-831 0000-9490204 -5867289 ling 5947658 0062988 9443 0000 5824198 6071119 lingmvdeo 1352293 0094221 1435 0000 1167613 1536974 _cons 1832686 059662 3072 0000 1715744 1949628 estat ovtest Ramsey RESET test using powers of the fitted values of lviv Ho: model has no omitted variables F(3, 20765) = 38316 Prob > F = 00000 predict plviv, xb g plviv2=plviv^2 g plviv3=plviv^3 g plviv4=plviv^4 reg lviv Montevideo ling lingmvdeo plviv2-plviv4 -------------+------------------------------ F( 6, 20765) = 632462 Model 98615552 6 164359253 Prob > F = 00000 Residual 539624828 20765 259872298 R-squared = 06463 -------------+------------------------------ Adj R-squared = 06462 Total 152578035 20771 734572408 Root MSE = 50978 lviv Coef Std Err t P> t [95% Conf Interval] Montevideo -1074234 4191677-256 0010-1895836 -2526328 ling 2172739 3647315 596 0000 1457837 2887641 lingmvdeo 2993238 0761617 393 0000 1500409 4486067 plviv2-1313952 1646277-798 0000-1636635 -991269 plviv3 1669429 0177557 940 0000 1321403 2017455 plviv4-0065494 0006709-976 0000-0078644 -0052344 _cons 1096083 5138965 2133 0000 9953553 1196811 test plviv2 plviv3 plviv4 ( 1) plviv2 = 0 ( 2) plviv3 = 0 ( 3) plviv4 = 0 Página 4
F( 3, 20765) = 38316 Prob > F = 00000 *Calcular el estadìstico F del contraste por otra via: Usando (Rbeta_es-r)'{[RVar(beta_es)R']^-1}(Rbeta_es-r)/3 *Notar que la matriz de Varcovar es la calculada màs arriba que se reproduce a continuación matrix list Varcovar symmetric Varcovar[4,4] Montevideo ling lingmvdeo _cons Montevideo 00854101 ling 00037473 00003967 lingmvdeo -0008674-00003967 00008878 _cons -00355955-00037473 00037473 00355955 log close log: C:\datos\docencia\econIccee\practicas2009\chowlog log type: text closed on: 17 Sep 2009, 17:58:53 ---- ---------------------------------------- Página 5