Two-Stage Least Squares

Example: Two-Stage Least Squares

To create this example:
  1. In the Tasks section, expand the Econometrics folder, and then double-click Causal Models. The user interface for the Causal Models task opens.
  2. On the Data tab, select the SASHELP.PRICEDATA data set.
    Tip
    If the data set is not available from the drop-down list, click Select a table icon. In the Choose a Table window, expand the library that contains the data set that you want to use. Select the data set for the example and click OK. The selected data set should now appear in the drop-down list.
  3. Assign columns to these roles:
    Role
    Column Name
    Dependent variable
    sale
    Exogenous explanatory variables
    price
    Endogenous explanatory variables
    cost
    Excluded instrumental variables
    price1
    price2
  4. To run the task, click Submit SAS Code Icon.
Here is a subset of the results:
Model Summary, 2 SLS Estimation Summary

Assigning Data to Roles

To perform a two-stage least squares analysis, you must assign an input data set. To filter the input data source, click Filter Icon.
You also must assign variables to the Dependent variable, Exogenous explanatory variables, Endogenous explanatory variables, and Excluded instrumental variables roles. The number of variables that you assign to the Excluded instrumental variables role must be greater than or equal to the number of endogenous explanatory variables.
Role
Description
Roles
Dependent variable
specifies the dependent variable for the equation. The equation is in this format:y sub 1 , equals , c sub 0 , plus , c sub 1 end sub , times , y sub 2 , plus , c sub 2 , times , y sub 3 , plus , c sub 3 , times , x sub 1 , plus , c sub 4 , times , x sub 2. Click image for alternative formats..
In this equation:
  • y1 is the dependent variable.
  • y2 and y3 are endogenous explanatory variables.
  • x1 and x2 are exogenous explanatory variables.
Exogenous explanatory variables
specifies a factor in the model whose values are not determined by the states of other variables in the system.
Endogenous explanatory variables
specifies a factor in the model whose values are determined by the states of other variables in the system.
Excluded instrumental variables
specifies the variables not to include in the equation.
Additional Roles
Group analysis by
enables you to obtain separate analyses of observations for each unique group.

Setting Options

Option
Description
Methods
Optimization method
specifies the optimization method to use.
You can use the default method, or you can choose from these methods:
  • Gauss-Newton
  • Marquardt-Levenberg
Maximum number of iterations
specifies the maximum number of iterations for the selected method. You can use the default value or specify a custom value.
Statistics
You can specify whether the results include the statistics that the task creates by default, the default statistics and any additional statistics that you select, or no statistics.
Here are the additional statistics that you can include in the results:
  • correlations of the parameter estimates
  • covariances of the parameter estimates
  • iteration history of the objective function and parameter estimates
Plots
By default, a plot of the predicted and actual values is included in the results. You can choose to display all of the plots, selected additional plots, or no plots.
You can include these additional plots in the results:
  • autocorrelation plot
  • inverse autocorrelation of residuals
  • partial autocorrelation of residuals
  • QQ plot of residuals
  • residuals
  • studentized residuals
  • histogram of residuals

Creating the Output Data Sets

You can create a data set that contains the parameter estimates from the analysis.