CSPATIALREG Procedure
Parameter Naming Conventions for RESTRICT, TEST, BOUNDS, and INIT Statements
This section describes how you can refer to the parameters in the MODEL and SPATIALEFFECTS statements when you use the RESTRICT, TEST, BOUNDS, or INIT statement. The following examples use the RESTRICT statement, but the same remarks apply to naming parameters when you use the TEST, BOUNDS, or INIT statement. The names of the parameters are displayed in the "Parameter Estimates" table if you specify the option. If a parameter name contains a blank or some other special character (such as '*', '-', '(', or ')'), then you must use the internal name of the parameter to refer to that parameter in the RESTRICT, TEST, BOUNDS, or INIT statement. You can specify the PRINTINTERNALNAMES option in the PROC CSPATIALREG statement if you want to see the internal names of the parameters. When you specify the PRINTINTERNALNAMES option, the "Parameter Estimates" table includes an additional column that shows the internal name of each parameter.
To impose a restriction on a parameter that is related to a regressor in the MODEL statement, you simply use the name of the regressor itself. Suppose that your model is
model y = x1-x3 / type=SAR;
where x1–x3 are continuous variables. Suppose you want to restrict the parameter that is associated with the regressor x3 to be greater than 1.7. You should provide the following statement:
RESTRICT x3 > 1.7;
To impose a restriction on a parameter that is associated with a regressor in the SPATIALEFFECTS statement, you can form the name of the parameter by adding the prefix W_ to the name of the regressor. Suppose that your MODEL and SPATIALEFFECTS statements are as follows:
model y = x1-x3 / type=SAR;
spatialeffects x1 x2 x3;
Suppose you want to restrict the parameter that is related to the x3 regressor in the SPATIALEFFECTS statement to be less than 1.0. You should refer to the parameter as W_x3 and provide the following statement:
RESTRICT W_x3 < 1.0;
Even though the regressor x3 appears in both the MODEL and SPATIALEFFECTS statements, the parameter that is associated with x3 in the MODEL statement is, of course, different from the parameter that is associated with x3 in the SPATIALEFFECTS statement. Thus, when you use the name of a regressor in a RESTRICT statement without any prefix, it refers to the parameter that is associated with that regressor in the MODEL statement. Meanwhile, when you use the name of a regressor in a RESTRICT statement with the prefix W_, it refers to the parameter that is associated with that regressor in the SPATIALEFFECTS statement. Note that the intercept is not included in the SPATIALEFFECTS statement.
Referring to Class Level Parameters
When your MODEL includes a classification variable, you can impose restrictions on the parameters associated with each of the levels that are related to the classification variable as follows.
Suppose that your classification variable is named C and has three levels: 0, 1, and 2. Suppose that your model is the following:
class C;
model y = x1 x2 C;
Adding a classification variable as a regressor to your model introduces additional parameters to your model, each of which is associated with one of the levels of the classification variable. You can form the name of the parameter that is associated with a particular level of your classification variable by inserting the underscore character between the name of the classification variable and the value of the level. Thus, to restrict the parameter that is associated with level 0 of the classification variable C to always be greater than 0.7, you refer to the parameter as C_0 and provide the following statement:
RESTRICT C_0 > 0.7;
Referring to Parameters Associated with Interactions between Regressors
When a regressor in your model involves an interaction between other regressors, you can impose restrictions on the parameters that are associated with the interaction as described in this section.
Suppose you have the following model:
model y = x1 x2 x3*x4;
You can form the name of the parameter that is associated with the interaction regressor x3*x4 by replacing the multiplication sign with an underscore. Thus, x3_x4 refers to the parameter that is associated with the interaction regressor x3*x4.
You refer to interactions between regressors and CLASS variables in exactly the same way. Suppose you have a CLASS variable named C that has three levels (0, 1, and 2), and your model is the following:
class C;
model y = x1 x2 C*x3;
The interaction between the continuous variable x3 and the CLASS variable C introduces three additional parameters, which are named x3_C_0, x3_C_1, and x3_C_2. Note that, although the order of the terms in the interaction is C followed by x3, the name of the parameter that is associated with the interaction is formed by placing the name of the continuous variable x3 first, followed by an underscore, followed by the name of the CLASS variable C, then another underscore, and then the level value. Once again, depending on the parameterization that you specify in your CLASS statement, for each interaction in your model that involves a CLASS variable, one of the parameters that are associated with that interaction can be dropped from your model before optimization.
The name of a parameter that is associated with a nested interaction is formed in a slightly different way. Suppose you have a CLASS variable named C that has three levels (0, 1, and 2) and your model is the following:
class C;
model y = x1 x2 x3(C);
The nested interaction between the continuous variable x3 and the CLASS variable C introduces three additional parameters, which are named x3_C__0, x3_C__1, and x3_C__2. Note how the name in each case was formed from the name of the regressor by replacing the left and right parentheses with underscores and then appending another underscore, followed by the level value.
Referring to Class Level Parameters with Negative Values
When the value of a level is a negative number, you must replace the minus sign with an underscore when you form the name of the parameter that is associated with that particular level of the classification variable. For example, suppose your classification variable is named D and has four levels: –1, 0, 1, and 2. Suppose that your model is the following:
class D;
model y = x1 x2 D;
To restrict the parameter that is associated with level –1 of the classification variable D to always be less than 0.4, you refer to the parameter as D__1 (note that there are two underscores in this parameter name: one to connect the name of the classification variable to its value and the other to replace the minus sign in the value itself) and provide the following statement:
RESTRICT D__1 < 0.4;
Dropping a Class Level Parameter to Avoid Collinearity
Depending on the parameterization that you impose on your classification variable, one of the parameters that are associated with its levels might be dropped from your model before optimization in order to avoid collinearity. For example, when the default parameterization GLM is imposed, the parameter that is associated with the last level of your classification variable is dropped before optimization. If you attempt to impose a restriction on a dropped parameter by using the RESTRICT statement, PROC CSPATIALREG issues an error message in the log.
For example, suppose again that your classification variable is named C and has three levels: 0, 1, and 2. Suppose that your model is the following:
class C;
model y = x1 x2 C;
Because no additional options are specified in the CLASS statement, GLM parameterization is assumed. This means that the parameter named C_2 (which is the parameter associated with the last level of your classification variable) is dropped from your model before the optimizer is invoked. Therefore, you get an error if you attempt to restrict the C_2 parameter in any way by referring to it in a RESTRICT statement. For example, the following RESTRICT statement will generate an error:
RESTRICT C_2 < 0.3;
Referring to Implicit Parameters
For all models in PROC CSPATIALREG, one or more implicit parameters are added to your model before optimization. You can impose restrictions on these implicit parameters as follows.
If you have a linear model or an SLX model, the _sigma2 parameter is added to your model. For the SDM or SAR model, the _rho and _sigma2 parameters are added to your model. For the SEM or SDEM, the _lambda and _sigma2 parameters are added to your model.
Whenever your model type dictates the addition of one or more of these implicit parameters, you can impose restrictions on the implicit parameters by referring to them by name. For example, assuming that your model type implies the existence of the _rho parameter, you can restrict _rho to be greater than 0 as follows:
RESTRICT _rho > 0.0;