A single test of whether any of the group proportions differs from the overall proportion is given by the CHISQ option in PROC FREQ when applied to a G×2 or 2×G table of your data (the two columns or rows being positive and negative response). Significant results indicate that at least one proportion differs from the overall proportion. Tests and a graph of each group comparison to overall can be done in PROC LOGISTIC using the DIFF=ANOM option in the LSMEANS statement. You can also adjust the individual p-values for multiple testing. In addition to the adjustments available using the ADJUST= option in the LSMEANS statement in LOGISTIC, the p-values can also be adjusted by importing them into PROC MULTTEST and using the methods available in that procedure.
The sample sizes (N) and the number that respond positive (Npos) in each of five groups are recorded in a SAS data set named P. The observed proportion (Npos/N) is also computed.
|
These statements transform the above summarized data into the form suitable to produce a 2×2 table for analysis in PROC FREQ. The CHISQ option produces a test of whether the groups all have equal positive response (Response=1) probabilities.
data p2; set p; Response=1; Count=Npos; output; Response=0; Count=N-Npos; output; run; proc freq data=p2; weight Count; table Group*Response / chisq; run;
The marginally significant Pearson chi-square test from PROC FREQ indicates that some proportions might differ from the overall proportion (p=0.0537). The Likelihood Ratio chi-square (equivalent in large samples) provides a similar result.
|
The following statements fit a one-way logistic model. The LSMEANS statement estimates the group log odds and proportions. Note that the GLM parameterization (PARAM=GLM) of the GROUP levels must be used in order to use the LSMEANS statement. The ILINK option provides the group probability estimates (labeled "Mean"). The DIFF=ANOM option compares the five group proportions to the overall proportion. The ADJUST=BON option adjusts the p-values using the Bonferroni method. The ODS OUTPUT statement saves the comparisons table to a data set for later use as described below. Note that if there are covariates in addition to your Group variable, they can be added to the model and the LSMEANS statement will provide the comparisons adjusted for the effects of the covariates.
proc logistic data=p; class Group / param=glm; model Npos/N = Group; lsmeans Group / ilink diff=anom adjust=bon; ods output Diffs=GrpDiffs; run;
Note that the likelihood ratio chi-square test from PROC FREQ matches the one in the "Testing Global Null Hypothesis: BETA=0" table from PROC LOGISTIC. The "Group Least Squares Means" table provides the group log odds (Estimate column) and proportions (Mean column). The results shown in the "Differences of Group Least Squares Means" table indicate that only the last group differs from overall (raw p=0.0046, Bonferroni-adjusted p=0.0230). The LSMEANS statement provides a plot comparing each group's log odds with the overall log odds (-1.3479). If a group's bar extends beyond the Bonferroni-adjusted upper or lower decision limit (UDL or LDL), then that group's log odds and proportion differ significantly from overall. By default, the significance level for the decision limits is 0.05. The plot visually confirms the conclusion from PROC LOGISTIC that only the last group differs from overall.
|
If desired, any of the p-value adjustment methods available in PROC MULTTEST (except the resampling-based bootstrap or permutation methods) can be used to adjust the difference p-values. The ODS OUTPUT statement above saved the p-values to a data set named GrpDiffs. In that data set, the variable containing the raw p-values is named Probz. Use the INPVALUES(variable-name)=data-set-name option in PROC MULTTEST to read the set of p-values. Specify the appropriate option for your choice of nonresampling-based adjustment method. Below, the BON option is used to again to provide the Bonferroni adjustment. The HOLM option is also used to provide the more powerful stepdown Bonferroni adjustment.
proc multtest inpvalues(Probz)=GrpDiffs bon holm; run;
The results show that the adjusted p-values from the stepdown method are very similar to the ordinary Bonferroni method in this case.
|
Product Family | Product | System | SAS Release | |
Reported | Fixed* | |||
SAS System | SAS/STAT | All | n/a |
Type: | Usage Note |
Priority: | low |
Topic: | Analytics ==> Analysis of Means SAS Reference ==> Procedures ==> FREQ SAS Reference ==> Procedures ==> MULTTEST Analytics ==> Categorical Data Analysis Analytics ==> Descriptive Statistics SAS Reference ==> Procedures ==> LOGISTIC |
Date Modified: | 2006-05-10 11:19:08 |
Date Created: | 2002-12-16 10:56:38 |