Model Fitting: Logistic Regression |
Effects Tab |
You can use the Effects tab to add several different types of effects to your model. All effects appear in the Effects in Model list. You can specify the following types of effects:
main effects
crossed effects
nested effects
You can also use the tab to quickly create certain standard effects: factorial effects, polynomial effects, and multivariate polynomial effects.
The notation for an effect consists of variable names, asterisks, and at most one pair of parentheses. The asterisks denote interactions; the parentheses denote nested effects. There are two rules to follow when specifying effects:
A nominal variable can appear in an effect at most once.
An interval variable cannot appear inside parentheses.
The following text describes how to specify effects on the Effects tab. In the descriptions, assume that A, B, and C are classification variables and that X and Y are interval variables.
The notation for a main effect is just the name of the variable itself.
To specify a main effect:
Select Main from the Standard Effects list.
Select one or more variables from the Explanatory Variables list.
Click Add.
The effects are added to the Effects in Model list, as shown in Figure 23.6. Each main effect appears on a line by itself in the Effects in Model list. Because main effects are automatically added to this list when you select a variable on the Variables tab, you usually do not need to add main effects.
The notation for a crossed effect is two or more variable names that are joined by asterisks. A crossed effect can involve one or more interval variables (such as X*X and X*Y) or two or more nominal variables (such as A*B, B*C, and A*B*C). You cannot cross a nominal variable with itself, but you can create crossed effects that involve both interval variables and nominal variables, such as X*A.
To specify a crossed effect in which each variable appears once (such as X*Y):
Select Cross from the Standard Effects list.
Select two or more variables from the Explanatory Variables list.
Click Add.
For example, the preceding steps were used to create the X*Y effect shown in Figure 23.7.
To cross variables with effects already in the model:
Select Cross from the Standard Effects list.
Select one or more variables from the Explanatory Variables list.
Select one or more effects from the Effects in Model list.
Click Cross, located to the right of the Effects in Model list.
For example, Figure 23.7 shows one way to create the effect X*X*Y. You can select the X variable from the Explanatory Variables list and the X*Y effect from the Effects in Model list. The X*X*Y effect is created when you click Cross.
The notation for a nested effect contains two parts. The first part is a main effect or crossed effect. The second part consists of a classification variable or an interaction between classification variables. The second part is enclosed in parentheses. The main effect or crossed effect is said to be "nested within" the effects in parentheses. For example, A(B*C) means "effect A is nested within the levels of the factors B and C." The Standard Effects value is ignored when you specify nested effects.
To create a nested effect, the effect outside the parentheses must already be specified in the Effects in Model list.
To create a nested effect:
Select one or more nominal variables from the Explanatory Variables list. These variables will appear inside the parentheses.
Select one or more effects from the Effects in Model list. These variables will appear outside the parentheses. Make sure that the nominal variables selected in the Explanatory Variables list do not appear in any of the effects selected in the Effects in Model list.
Click Nest, located to the right of the Effects in Model list.
The effects in the Effects in Model list are replaced with the nested effects.
For example, Figure 23.8 shows one way to create the effect A(B*C). Select the B and C variables from the Explanatory Variables list, and select the A main effect from the Effects in Model list. The A(B*C) effect is created when you click Nest. It replaces the A effect that is currently in the list.
Factorial effects are -way interactions between a set of variables.
To create factorial effects:
Select Factorial from the Standard Effects list.
Enter the Degree of the model.
Select two or more variables from the Explanatory Variables list.
Click Add.
The factorial effects are added to the Effects in Model list. Any effects already in the model (for example, main effects) are highlighted, although their position in the Effects in Model list does not change.
For example, Figure 23.9 shows how to create a full three-way factorial model with the variables A, B, and C. The following effects are added to the Effects in Model list: A, B, C, A*B, A*C, B*C, and A*B*C.
Interactions of an interval variable with itself are called polynomial effects. Each term is a monomial in one variable.
To create polynomial effects:
Select Polynomial from the Standard Effects list.
Enter the Degree of the model. (The maximum degree is 10.)
Select one or more variables from the Explanatory Variables list.
Click Add.
The polynomial effects are added to the Effects in Model list. Any effects already in the model (for example, main effects) are highlighted, although their position in the Effects in Model list does not change.
For example, Figure 23.10 shows how to create all terms in a degree-three polynomial in the variable X. The following effects are added to the Effects in Model list: X, X*X, and X*X*X.
Multivariate polynomial effects are polynomial and interaction effects among a group of variables. If you select variables and request effects from a degree- multivariate polynomial, then each term is a multivariate monomial, with degree at most .
To create multivariate polynomial interaction effects:
Select Multivariate Polynomial from the Standard Effects list.
Enter the Degree of the model. (The maximum degree is 4.)
Select one or more variables from the Explanatory Variables list.
Click Add.
The polynomial effects are added to the Effects in Model list. Any effects already in the model (for example, main effects) are highlighted, although their position in the Effects in Model list does not change.
For example, Figure 23.11 shows how to create all main effects and valid two-way interactions among the three variables X, Y, and A. The following effects are added to the Effects in Model list: X, Y, A, X*X, Y*Y, X*Y, X*A, and Y*A. The term A*A is not created because A is a classification variable.
You can reorder and remove effects in the Effects in Model list. The order in which effects appear in the list is the order in which the effects appear in the MODEL statement of SAS/STAT procedures.
moves selected effects up one position in the Effects in Model list.
moves selected effects down one position in the Effects in Model list.
removes the selected effects from the Effects in Model list.
deletes all effects and then adds main effects to the Effects in Model list.
Copyright © SAS Institute, Inc. All Rights Reserved.