TESTID <'label'> variable-list </ options>;
The TESTID statement tests whether a criterion that you specify is valid for identifying a causal effect. The form of the variable-list depends on which method you specify in the METHOD= option in the PROC CAUSALGRAPH statement and is described later in this section. The causal effect to be identified is specified by the IDENTIFY statement. You must specify the IDENTIFY statement in order to use a TESTID statement.
For example, the following code tests two specified adjustment sets to determine whether each set is sufficient for the unbiased estimation of the causal effect of X on Y:
proc causalgraph method=adjustment;
model 'TESTID Demo'
Z ==> X ==> Y,
U => X Y,
W => Z U;
identify X => Y;
testid U;
testid U W;
run;
The following example tests whether you can use the variable Z as an instrument for the causal effect of X on Y when U is unmeasured:
proc causalgraph method=iv;
model 'TESTID Demo'
Z ==> X ==> Y,
U => X Y,
W => Z U;
identify X => Y;
testid Z;
unmeasured U;
run;
For more information about when an estimation criterion is valid, see the section Causal Effect Identification.
When METHOD=ADJUSTMENT, ANCESTOR, BACKDOOR, POUTCOME, or PTREATMENT, or when you omit the METHOD= option, variable-list is a list of adjustment variables. This list of variables is tested to see whether it forms a valid adjustment set according to the criterion that you specify in the METHOD= option. For these adjustment methods, the list of variables can be empty. If you specify a set of prescribed adjustment variables in the IDENTIFY statement, then these prescribed adjustment variables are added to the list of variables that you specify in each TESTID statement. If variable-list is empty and there are no prescribed adjustment variables in the IDENTIFY statement, then the TESTID statement tests whether the causal effect is identified without any adjustment.
When METHOD=IV, variable-list consists of a single variable name. This variable name is required and cannot be empty. The single variable is tested to see whether it is an instrumental variable that can be used to estimate the causal effect that you specify in the IDENTIFY statement. If you specify a set of prescribed adjustment variables in the IDENTIFY statement, these variables are ignored.
Regardless of the value of the METHOD= option, every variable in a TESTID statement must be observed. This means that any variable name in variables cannot also be specified in the UNMEASURED statement.
You can specify multiple TESTID statements in each run of the CAUSALGRAPH procedure. Each proposed criterion that you specify in a TESTID statement is tested using each model that you specify in a MODEL statement unless you specify the NOANALYSIS option in the MODEL statement.
The label is optional and can be any string of characters enclosed in quotation marks. If you specify a label, it must be the first item in the TESTID statement. If you do not specify a label, then a test name is automatically generated. The autogenerated name has the form "Testi", where i is the smallest positive integer such that each test name is unique. It is recommended that you use your own labels so that you can identify the tests easily in the output results.
You can specify the following options in the TESTID statement: