Two-sided test
Single parameter test
By default, tests of parameters provided by modeling procedures are two-tailed tests of the null hypothesis that each parameter is equal to zero. This is true of the estimates that appear in the table of parameter estimates provided by the modeling procedure as well as the tests provided by the TEST, ESTIMATE, and CONTRAST statements (where available). The following methods can be used to test the hypothesis that a parameter in the model is equal to a nonzero constant against an alternative hypothesis of inequality.
- Specify the null constant in the TESTVALUE= option in the ESTIMATE statement (if available). For procedures like GENMOD, GLIMMIX, GLM, and MIXED whose ESTIMATE statement does not support the TESTVALUE= option, save the model using the STORE statement and then use the PLM procedure to read in the model and then use the TESTVALUE= option in its ESTIMATE statement. Or
- Use an expression that subtracts the null constant from the parameter in the TEST statement (if available), or
- Use the NULL= option in the NLEST macro. Version 1.8 or later of the macro is required.
For example, all three of these methods are available for a model fit in the LOGISTIC procedure. Consider the data in the example titled "Logistic Regression" in the GENMOD documentation. The following code illustrates the above methods to test the null hypothesis that the X parameter equals 1. The TEST statement tests that the specified expression equals 0, but by specifying x-1, the test is equivalent to testing that x=0. To use the NLEST macro, the model must be saved using the STORE statement in the modeling procedure. The parameter expression to be tested is specified in f= using names that the macro assigns to the parameters: b_p1, b_p2, and so on in order shown in the table of parameter estimates. The X parameter in this model is the second parameter and is assigned the name b_p2 (the intercept is b_p1).
proc logistic data=drug;
class drug;
model r/n = x drug;
Test_Xeq1: test x-1;
estimate 'Test X=1' x 1 / testvalue=1;
store log;
run;
%nlest(instore=log, f=b_p2, null=1, label=Test X=1)
The small p-value for X, 0.0098, in the table of parameter estimates below is a test that the X parameter equals zero. The p-value for X provided by all three methods, 0.2011, shown in the following tables is a test that the X parameter equals 1. Because the estimated parameter, 1.9794, is closer to 1 than to 0, the larger p-value is expected.
The LOGISTIC Procedure
1 |
-1.6330 |
0.4048 |
16.2761 |
<.0001 |
1 |
1.9794 |
0.7660 |
6.6770 |
0.0098 |
1 |
-0.9833 |
0.4673 |
4.4282 |
0.0353 |
1 |
-0.1039 |
0.3019 |
0.1184 |
0.7308 |
1 |
-1.8826 |
0.5072 |
13.7751 |
0.0002 |
1 |
1.0574 |
0.3631 |
8.4819 |
0.0036 |
1.9794 |
0.7660 |
1.000 |
1.28 |
0.2011 |
|
1.9794 |
0.7660 |
1.63464 |
0.2011 |
0.05 |
0.4780 |
3.4807 |
|
Joint test of multiple parameters
To test the joint hypothesis that several parameters all equal zero or a nonzero constant, use the JOINT option in the ESTIMATE statement. In the TEST statement, specify appropriate expressions for the parameters separated by commas. The NLEST macro cannot provide a joint test.
Consider the data in the example titled "Predicting Weight by Height and Age" in the documentation of the REG procedure and the two-variable model to be fit using least squares estimation. The model is fitted in both the REG and ORTHOREG procedures below. The ESTIMATE statement is available in ORTHOREG and the TEST statement is available in REG. The following statements use the ESTIMATE and TEST statements to provide a joint test that the height parameter is equal to 3 and that the age parameter equals 2.
proc orthoreg data=htwt;
model weight = height age;
estimate 'height' height 1, 'age' age 1 / joint(label='joint ht,age') testvalue=3 2;
run;
proc reg data=htwt;
model weight=height age;
test height-3;
test age-2;
test height-3, age-2;
run; quit;
Estimates for the height and age predictors and tests that each equals zero are provided in the first table from PROC ORTHOREG. Note the small p-values (<0.0001). The results from the ESTIMATE statement appear in the next two tables. In the "Estimates" table, each parameter is tested against the specified null value. Note the increases in the p-values. The p-value, 0.4272, in the "F Test for Estimates" table is a joint test that both parameters are equal to the specified null values. The results from the TEST statements in PROC REG produce the same p-values for the single parameter and the joint tests.
The ORTHOREG Procedure
1 |
-127.819907444769 |
12.09899610 |
-10.56 |
<.0001 |
1 |
3.090048039353 |
0.257341500 |
12.01 |
<.0001 |
1 |
2.402749142645 |
0.551030316 |
4.36 |
<.0001 |
3.0900 |
0.2573 |
234 |
3.000 |
0.35 |
0.7267 |
2.4027 |
0.5510 |
234 |
2.000 |
0.73 |
0.4656 |
|
The REG Procedure
1 |
17.24687 |
0.12 |
0.7267 |
234 |
140.85795 |
|
|
1 |
75.24881 |
0.53 |
0.4656 |
234 |
140.85795 |
|
|
2 |
120.25004 |
0.85 |
0.4272 |
234 |
140.85795 |
|
|
|
One-sided test
Single parameter test
To test that any single parameter is greater than (or less than) zero, you can halve the p-value of the two-tailed test in the table of parameter estimates, assuming that the parameter estimates are normally (or at least symmetrically) distributed and that the observed parameter estimate satisfies the alternative hypothesis. Generally, the parameters estimated by ordinary least squares or maximum likelihood are normally distributed. For example, if you want to test that a parameter exceeds zero and the parameter estimate is positive with p-value equal to 0.08, then the one-tailed p-value is 0.04. It is important that the decision to conduct a one-sided test, rather than a two-sided test, is be made before examining or analyzing the data.
To test that a parameter is greater than (or less than) a constant other than zero, the above halving method can also be used if the observed parameter satisfies the alternative hypothesis. The ESTIMATE statement in many procedures can provide the one-sided p-value directly by specifying the UPPER or LOWER option as appropriate. When using the TEST statement or NLEST macro, halve the p-variable as above. To test that the X parameter in the above example is greater than 1, the p-value computed by any of the methods (0.2011) can be halved since the observed estimate, 1.9794, is greater than 1. The following shows the results from adding the UPPER option in the ESTIMATE statement.
1.9794 |
0.7660 |
1.000 |
1.28 |
Upper |
0.1005 |
|
Joint test of multiple parameters
The above method of halving the p-value cannot be used for multiple degree-of-freedom contrasts such as for a joint test of multiple parameters. However, the ESTIMATE statement with the UPPER or LOWER option can be used with the JOINT option to apply an appropriate one-tailed restriction to obtain a one-sided joint test using the chi-bar-square statistic. For details, see the descriptions of the UPPER, LOWER, and JOINT options in the description of the ESTIMATE statement in the "Shared Concepts and Topics" chapter of the SAS/STAT® User's Guide.
The following tables result from adding the UPPER option in the ESTIMATE statement in the ORTHOREG step above. The first table provides separate one-sided tests that the parameters exceed the specified null values. The second table provides a joint one-sided test that both parameters exceed the specified null values.
3.0900 |
0.2573 |
234 |
3.000 |
0.35 |
Upper |
0.3634 |
2.4027 |
0.5510 |
234 |
2.000 |
0.73 |
Upper |
0.2328 |
2 |
234 |
0.85 |
0.4272 |
1.71 |
0.1547 |
|
Operating System and Release Information
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.