Aula de laboratório - Modelos de Equações Simultâneas

Autor

Rafael Bressan

Data de Publicação

6 de setembro de 2023

Introdução

Vamos utilizar a seguinte notação geral para um SEM (Simultaneous Equations Model) composto de \(q\) variáveis endógenas \(y_1, \ldots, y_q\) e \(k\) variáveis exógenas \(x_1, \ldots, x_k\).

\[ \begin{align*} y_1&=\alpha_{12}y_2+\ldots +\alpha_{1q}y_q + \beta_{10}+\beta_{11}x_1+\ldots+\beta_{1k}x_k+u_1\\ y_2&=\alpha_{21}y_1+\ldots +\alpha_{2q}y_q + \beta_{20}+\beta_{21}x_1+\ldots+\beta_{2k}x_k+u_2\\ \vdots & \\ y_q&=\alpha_{q1}y_1+\ldots +\alpha_{qq-1}y_{q-1} + \beta_{q0}+\beta_{q1}x_1+\ldots+\beta_{qk}x_k+u_q \end{align*} \]

A condição de ordem para identificação de alguma destas equações é tal que o número de variáveis exógenas (ou predeterminadas) excluídas da equação não deve ser menor que o número de variáveis endógenas incluídas nessa equação menos 1, \(K – k \geq m – 1\).

Conseguida a identificação da equação, os regressores exógenos excluídos servirão de variáveis instrumentais na estimação através de MQ2E.

Oferta de Trabalho de Mulheres Casadas Trabalhando

Vimos em aula como estimar esta equação de oferta separadamente usando MQ2E.

\[ \begin{align*} hours&=\alpha_1 lwage + \beta_{10}+ \beta_{11}educ+\beta_{12}age+\beta_{13}kidslt6+\beta_{14}nwifeinc+u_1\\ lwage&=\alpha_2 hours + \beta_{20}+ \beta_{21}educ+ \beta_{22}exper+\beta_{23}exper^2+ u_2 \end{align*} \]

  • Qual ou quais destas equações são identificadas?

Vamos então estimar as duas equações de forma conjunta, ambas através de MQ2E utilizando o pacote systemfit.

library(systemfit)
library(wooldridge)

data("mroz")

df <- mroz[!is.na(mroz$wage), ]

# Definindo o sistema de equações e os instrumentos
eq.hrs <- hours ~ lwage + educ + age + kidslt6 + nwifeinc
eq.wage <- lwage ~ hours + educ + exper + expersq
eq.system <- list(eq.hrs, eq.wage)
inst <- ~ educ + age + kidslt6 + nwifeinc + exper + expersq

# Estimando por MQ2E todas as equações conjuntamente
mq2e <- systemfit(eq.system, inst = inst, data = df, method = "2SLS")
summary(mq2e)

systemfit results 
method: 2SLS 

         N  DF       SSR detRCov   OLS-R2 McElroy-R2
system 856 845 773893318  155089 -2.00762   0.748802

      N  DF         SSR         MSE        RMSE        R2    Adj R2
eq1 428 422 7.73893e+08 1.83387e+06 1354.204549 -2.007617 -2.043253
eq2 428 423 1.95266e+02 4.61621e-01    0.679427  0.125654  0.117385

The covariance matrix of the residuals
            eq1         eq2
eq1 1833869.960 -831.542683
eq2    -831.543    0.461621

The correlations of the residuals
          eq1       eq2
eq1  1.000000 -0.903769
eq2 -0.903769  1.000000


2SLS estimates for 'eq1' (equation 1)
Model Formula: hours ~ lwage + educ + age + kidslt6 + nwifeinc
Instruments: ~educ + age + kidslt6 + nwifeinc + exper + expersq

              Estimate Std. Error  t value   Pr(>|t|)    
(Intercept) 2225.66187  574.56413  3.87365 0.00012424 ***
lwage       1639.55563  470.57569  3.48415 0.00054535 ***
educ        -183.75128   59.09981 -3.10917 0.00200323 ** 
age           -7.80609    9.37801 -0.83238 0.40566400    
kidslt6     -198.15431  182.92914 -1.08323 0.27932494    
nwifeinc     -10.16959    6.61474 -1.53741 0.12494168    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 1354.204549 on 422 degrees of freedom
Number of observations: 428 Degrees of Freedom: 422 
SSR: 773893123.128241 MSE: 1833869.96002 Root MSE: 1354.204549 
Multiple R-Squared: -2.007617 Adjusted R-Squared: -2.043253 


2SLS estimates for 'eq2' (equation 2)
Model Formula: lwage ~ hours + educ + exper + expersq
Instruments: ~educ + age + kidslt6 + nwifeinc + exper + expersq

                Estimate   Std. Error  t value   Pr(>|t|)    
(Intercept) -0.655725423  0.337788290 -1.94123   0.052894 .  
hours        0.000125900  0.000254611  0.49448   0.621223    
educ         0.110330004  0.015524358  7.10690 5.0768e-12 ***
exper        0.034582356  0.019491555  1.77422   0.076746 .  
expersq     -0.000705769  0.000454080 -1.55428   0.120865    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.679427 on 423 degrees of freedom
Number of observations: 428 Degrees of Freedom: 423 
SSR: 195.265558 MSE: 0.461621 Root MSE: 0.679427 
Multiple R-Squared: 0.125654 Adjusted R-Squared: 0.117385 

Um resultado interessante que foi apresentado é a matriz de correlação dos resíduos. Os resíduos das duas equações são fortemente correlacionados de forma negativa. O método de estimação de Mínimos Quadrados em 3 Estágios (MQ3E) pode ser utilizado para levar em consideração esta correlação e obter um estimador mais eficiente que o MQ2E.

Usar MQ3E com o systemfit é tão fácil quanto simplesmente trocar o argumento “method” da função.

Estimando por MQ2E todas as equações conjuntamente

mq3e <- systemfit(eq.system, inst = inst, data = df, method = "3SLS")
summary(mq3e)

systemfit results 
method: 3SLS 

         N  DF       SSR detRCov   OLS-R2 McElroy-R2
system 856 845 873749828  102713 -2.39569     0.8498

      N  DF         SSR         MSE        RMSE        R2   Adj R2
eq1 428 422 8.73750e+08 2.07050e+06 1438.922077 -2.395695 -2.43593
eq2 428 423 2.02143e+02 4.77879e-01    0.691288  0.094859  0.08630

The covariance matrix of the residuals used for estimation
            eq1         eq2
eq1 1833869.960 -831.542683
eq2    -831.543    0.461621

The covariance matrix of the residuals
            eq1         eq2
eq1 2070496.744 -941.665424
eq2    -941.665    0.477879

The correlations of the residuals
          eq1       eq2
eq1  1.000000 -0.946674
eq2 -0.946674  1.000000


3SLS estimates for 'eq1' (equation 1)
Model Formula: hours ~ lwage + educ + age + kidslt6 + nwifeinc
Instruments: ~educ + age + kidslt6 + nwifeinc + exper + expersq

               Estimate  Std. Error  t value   Pr(>|t|)    
(Intercept) 2305.857523  511.540693  4.50767 8.5013e-06 ***
lwage       1781.933421  439.884247  4.05091 6.0726e-05 ***
educ        -212.819503   53.727045 -3.96112 8.7558e-05 ***
age           -9.514998    7.960948 -1.19521    0.23268    
kidslt6     -192.359072  150.917508 -1.27460    0.20315    
nwifeinc      -0.176983    3.583623 -0.04939    0.96063    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 1438.922077 on 422 degrees of freedom
Number of observations: 428 Degrees of Freedom: 422 
SSR: 873749625.779235 MSE: 2070496.743553 Root MSE: 1438.922077 
Multiple R-Squared: -2.395695 Adjusted R-Squared: -2.435928 


3SLS estimates for 'eq2' (equation 2)
Model Formula: lwage ~ hours + educ + exper + expersq
Instruments: ~educ + age + kidslt6 + nwifeinc + exper + expersq

                Estimate   Std. Error  t value   Pr(>|t|)    
(Intercept) -0.693920325  0.335995508 -2.06527   0.039506 *  
hours        0.000190868  0.000247652  0.77071   0.441308    
educ         0.112738574  0.015368872  7.33551 1.1364e-12 ***
exper        0.021428535  0.015383608  1.39295   0.164368    
expersq     -0.000302959  0.000268028 -1.13033   0.258978    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.691288 on 423 degrees of freedom
Number of observations: 428 Degrees of Freedom: 423 
SSR: 202.142832 MSE: 0.477879 Root MSE: 0.691288 
Multiple R-Squared: 0.094859 Adjusted R-Squared: 0.0863