SYSLIN Procedure

Two-Stage Least Squares Estimation

In the supply and demand model, P is an endogenous variable, and consequently the OLS estimates are biased. The following example estimates this model using two-stage least squares:

proc syslin data=in 2sls;
   endogenous  p;
   instruments y u s;
   demand: model q = p y s;
   supply: model q = p u;
run;

The 2SLS option in the PROC SYSLIN statement specifies the two-stage least squares method. The ENDOGENOUS statement specifies that P is an endogenous regressor for which first-stage predicted values are substituted. You need to declare an endogenous variable in the ENDOGENOUS statement only if it is used as a regressor; thus although Q is endogenous in this model, it is not necessary to list it in the ENDOGENOUS statement.

Usually, all predetermined variables that appear in the system are used as instruments. The INSTRUMENTS statement specifies that the exogenous variables Y, U, and S are used as instruments for the first-stage regression to predict P.

The 2SLS results are shown in Figure 3 and Figure 4. The first-stage regressions are not shown. To see the first-stage regression results, use the FIRST option in the PROC SYSLIN statement.

Figure 3: 2SLS Results for Demand Equation

The SYSLIN Procedure
Two-Stage Least Squares Estimation

ModelDEMAND
Dependent Variableq
LabelQuantity

Analysis of Variance
SourceDFSum of SquaresMean SquareF ValuePr > F
Model39.6708923.223631115.58<.0001
Error561.5619560.027892  
Corrected Total5910.03724   

Root MSE0.16701R-Square0.86095
Dependent Mean1.30095Adj R-Sq0.85350
Coeff Var12.83744  

Parameter Estimates
VariableDFParameter
Estimate
Standard
Error
t ValuePr > |t|Variable
Label
Intercept11.9010481.1712311.620.1102Intercept
p1-1.115190.607395-1.840.0717Price
y10.4195460.1179553.560.0008Income
s10.3314750.0884723.750.0004Price of Substitutes


Figure 4: 2SLS Results for Supply Equation

The SYSLIN Procedure
Two-Stage Least Squares Estimation

ModelSUPPLY
Dependent Variableq
LabelQuantity

Analysis of Variance
SourceDFSum of SquaresMean SquareF ValuePr > F
Model29.6461094.823054253.96<.0001
Error571.0825030.018991  
Corrected Total5910.03724   

Root MSE0.13781R-Square0.89910
Dependent Mean1.30095Adj R-Sq0.89556
Coeff Var10.59291  

Parameter Estimates
VariableDFParameter
Estimate
Standard
Error
t ValuePr > |t|Variable
Label
Intercept1-0.518780.490999-1.060.2952Intercept
p11.3330800.05927122.49<.0001Price
u1-1.146230.243491-4.71<.0001Unit Cost


The 2SLS output is similar in form to the OLS output. However, the 2SLS results are based on predicted values for the endogenous regressors from the first stage instrumental regressions. This makes the analysis-of-variance table and the upper R squared statistics difficult to interpret. For more information, see the sections ANOVA Table for Instrumental Variables Methods and The R-Square Statistics.

Note that, unlike the OLS results, the 2SLS estimate for the P coefficient in the demand equation (–1.115) is negative.

Last updated: June 19, 2025