TABLES requests </ options> ;
The TABLES statement requests one-way to n-way frequency and crosstabulation tables and statistics for these tables.
If you omit the TABLES statement, PROC SURVEYFREQ generates one-way frequency tables for all DATA= data set variables that are not listed in the other statements.
The following argument is required in the TABLES statement:
specify the frequency and crosstabulation tables to produce. A request is composed of one variable name or several variable names separated by asterisks. To request a one-way frequency table, use a single variable. To request a two-way crosstabulation table, use an asterisk between two variables. To request a multiway table (an n-way table, where n > 2), separate the variables with asterisks. The unique values of these variables form the rows, columns, and layers of the table.
You can specify multiple TABLES statements in a single PROC SURVEYFREQ step. You can also specify any number of table requests in a single TABLES statement.
For two-way tables to multiway tables, the values of the last variable form the crosstabulation table columns and the values of the next-to-last variable form the rows. Each level (or combination of levels) of the other variables forms one layer. By default, PROC SURVEYFREQ produces a separate (two-way) crosstabulation table for each layer. For example, a specification of A * B * C * D in a TABLES statement produces k two-way tables, where k is the number of different combinations of levels for A and B. Each table lists the levels for D (columns) within each level of C (rows).
When you specify a multiway table request, you can select which two-way subtables to display by specifying level values of the layer variables. For example, the table request Year ['2012' '2013'] * A * B displays two-way subtables of A * B for Year '2012' and Year '2013'; this request suppresses the two-way subtables for levels of Year that are not specified. To subset a multiway table, you can specify formatted-level-values in square brackets after the layer variable names. You must enclose each formatted-level-value in single or double quotation marks. You can specify one or more levels of each layer variable; when you specify more than one level, separate the levels by a space or a comma.
Variable-level subsetting is available only for layer variables in multiway tables. It is not available for row or column variables in multiway or two-way tables, or for classification variables in one-way tables.
Variable-level subsetting controls only the display of multiway tables. It does not subset the data set, change the degrees of freedom, or otherwise affect the variance estimation.
To specify multiple table requests quickly, use a grouping syntax by placing parentheses around several variables and joining other variables or variable combinations. Table 3 shows some examples of grouping syntax.
Table 3: Grouping Syntax
| TABLES Request | Equivalent to |
|---|---|
A*(B C) |
A*B A*C |
(A B)*(C D) |
A*C B*C A*D B*D |
(A B C)*D |
A*D B*D C*D |
A – C |
A B C |
(A – C)*D |
A*D B*D C*D |
The TABLES statement variables are one or more variables from the DATA= input data set. These variables can be either character or numeric, but the procedure treats them as categorical variables. PROC SURVEYFREQ uses the formatted values of the TABLES variable to determine the categorical variable levels. If you assign a format to a variable by using a FORMAT statement, PROC SURVEYFREQ formats the values before dividing observations into the levels of a frequency or crosstabulation table. For more information, see the discussion of the FORMAT procedure in the Base SAS Procedures Guide and the discussions of the FORMAT statement and SAS formats in SAS Formats and Informats: Reference.
By default, the frequency or crosstabulation table lists the values of both character and numeric variables in ascending order based on internal (unformatted) variable values. You can change the order of the values in the table by specifying the ORDER= option in the PROC SURVEYFREQ statement. To list the values in ascending order by formatted value, use ORDER=FORMATTED.
If you request a frequency or crosstabulation table without specifying any options, PROC SURVEYFREQ produces the following for each table level or cell:
frequency (sample size)
weighted frequency, which estimates the population total
standard error of the weighted frequency
percentage, which estimates the population proportion
standard error of the percentage
The table displays weighted frequencies if your analysis includes a WEIGHT statement, or if you specify the WTFREQ option in the TABLES statement. The table also displays the number of observations that have missing values. For more information, see the sections One-Way Frequency Tables and Crosstabulation Tables.
Table 4 summarizes the options available in the TABLES statement. Descriptions of the options follow the table in alphabetical order.
Table 4: TABLES Statement Options
| Option | Description |
|---|---|
| Control Statistical Analysis | |
| AGREE | Requests kappa coefficients |
| ALPHA= | Sets level for confidence limits |
| CHISQ | Requests Rao-Scott chi-square test |
| CL | Requests confidence limits for percentages and |
| specifies confidence limit type for percentages | |
| CLWT | Requests confidence limits for weighted frequencies |
| COV | Requests covariances of frequency estimates |
| COVP | Requests covariances of proportion estimates |
| DF= | Specifies degrees of freedom |
| DISCORDDIFF | Requests discordant proportion difference |
| KAPPA | Requests simple kappa coefficient |
| LRCHISQ | Requests Rao-Scott likelihood ratio test |
| OR | Requests odds ratio and relative risks |
| RISK | Requests risks and risk difference |
| RISKDIFF | Requests risk difference |
| SENSPEC | Requests sensitivity and specificity |
| TESTP= | Specifies null proportions for one-way chi-square test |
| WCHISQ | Requests Wald chi-square test |
| WLLCHISQ | Requests Wald log-linear chi-square test |
| WTKAPPA | Requests weighted kappa coefficient |
| Request Additional Table Information | |
| CELLCHI2 | Displays cell contributions to the Pearson chi-square |
| COLUMN | Displays column percentages and standard errors |
| CV | Displays coefficients of variation for percentages |
| CVWT | Displays coefficients of variation for weighted frequencies |
| DEFF | Displays design effects for percentages |
| DEVIATION | Displays deviations of weighted frequencies |
| EXPECTED | Displays expected weighted frequencies |
| ONEWAYTABLE | Displays additional statistics in one-way tables |
| PEARSONRES | Displays Pearson residuals |
| ROW | Displays row percentages and standard errors |
| VAR | Displays variances of percentages |
| VARWT | Displays variances of weighted frequencies |
| WTFREQ | Displays totals and standard errors |
| when there is no WEIGHT statement | |
| Control Displayed Output | |
| DOMAIN=ROW | Displays one-way row domain analysis |
| NOCELLPERCENT | Suppresses display of overall percentages |
| NOFREQ | Suppresses display of frequency counts |
| NOPERCENT | Suppresses display of all percentages |
| NOPRINT | Suppresses display of tables but displays statistical tests |
| NOSPARSE | Suppresses display of zero-frequency rows and columns |
| NOSTD | Suppresses display of standard errors for all estimates |
| NOTOTAL | Suppresses display of row and column totals |
| NOWT | Suppresses display of weighted frequencies |
| Produce Statistical Graphics | |
| PLOTS= | Requests plots from ODS Graphics |
You can specify the following options:
requests the simple and weighted kappa coefficients together with their standard errors and confidence limits. You can specify options to request additional agreement coefficients and statistics.
Agreement coefficients can be computed for square two-way tables, where the number of rows is the same as the number of columns. For tables, the weighted kappa coefficient equals the simple kappa coefficient, and PROC SURVEYFREQ displays only the simple kappa coefficient. For more information, see the section Kappa Coefficients.
You can specify the confidence level in the ALPHA= option. By default, ALPHA=0.05, which produces 95% confidence limits.
Agreement coefficients are available for replication variance estimation methods (which you can request by specifying VARMETHOD=BOOTSTRAP, VARMETHOD=BRR, or VARMETHOD=JACKKNIFE or by including a REPWEIGHTS statement); agreement coefficients are not available for the Taylor series method (VARMETHOD=TAYLOR).
The weighted kappa coefficient is computed by using agreement weights that reflect the relative agreement between pairs of variable levels. Agreement weights are not the same as sampling weights, which you provide by specifying the WEIGHT statement. PROC SURVEYFREQ uses sampling weights to compute both the simple and weighted kappa coefficients. For more information, see the section Weighted Kappa Coefficient.
You can request the simple kappa coefficient or the weighted kappa coefficient separately by specifying the KAPPA or WTKAPPA option, respectively.
You can specify the following options:
requests the AC1 agreement coefficient. For more information, see the section AC1 Agreement Coefficient.
displays the "Kappa Details" table, which includes the following statistics for the simple kappa coefficient: observed agreement, chance-expected agreement, maximum kappa, and the measure. If the two-way table is
, the "Kappa Details" table also includes the prevalence index and the bias index. For more information, see the section Simple Kappa Coefficient.
If the two-way table is larger than , this option also displays the "Weighted Kappa Details" table, which includes the observed agreement and chance-expected agreement components of the weighted kappa coefficient. For more information, see the section Weighted Kappa Coefficient.
displays the "Kappa Details" table, which includes the following statistics for the simple kappa coefficient: observed agreement, chance-expected agreement, maximum kappa, and the measure. If the two-way table is
, the "Kappa Details" table also includes the prevalence index and the bias index. For more information, see the section Simple Kappa Coefficient.
requests the prevalence-adjusted bias-adjusted kappa coefficient. For more information, see the section Prevalence-Adjusted Bias-Adjusted Kappa Coefficient.
displays the agreement weights that PROC SURVEYFREQ uses to compute the weighted kappa coefficient. Agreement weights reflect the relative agreement between pairs of variable levels. By default, PROC SURVEYFREQ uses the Cicchetti-Allison form of agreement weights. If you specify the WT=FC option, the procedure uses the Fleiss-Cohen form of agreement weights. For more information, see the section Kappa Agreement Weights.
requests Fleiss-Cohen agreement weights for the weighted kappa computation. By default, PROC SURVEYFREQ uses Cicchetti-Allison agreement weights to compute the weighted kappa coefficient. Agreement weights reflect the relative agreement between pairs of variable levels. For more information, see the section Kappa Agreement Weights.
displays the "Weighted Kappa Details" table, which includes the observed agreement and chance-expected agreement components of the weighted kappa coefficient. This information is available when the two-way table is larger than . For more information, see the section Weighted Kappa Coefficient.
specifies the level for confidence limits. The value of must be between 0 and 1; a confidence level of
produces
% confidence limits. By default, ALPHA=0.05, which produces 95% confidence limits.
You can request confidence limits for percentages by specifying the CL option, and you can request confidence limits for weighted frequencies by specifying the CLWT option. For more information, see the sections Confidence Limits for Proportions and Confidence Limits for Totals.
The ALPHA= option also applies to confidence limits for the risks and risk difference (which you can request by specifying the RISK option) and to confidence limits for the odds ratio and relative risks (which you can request by specifying the OR option). For more information, see the sections Risks and Risk Difference and Odds Ratio and Relative Risks.
displays each table cell’s contribution to the Pearson chi-square statistic in the crosstabulation table. The cell chi-square is computed as , where
is the weighted frequency of the table cell and
is the expected weighted frequency, which is computed under the null hypothesis that the row and column variables are independent. You can display the expected weighted frequencies by specifying the EXPECTED option, and you can display the deviations
by specifying the DEVIATION option. For more information, see the sections Expected Weighted Frequency and Rao-Scott Chi-Square Test.
This option has no effect on one-way frequency tables. To display cell chi-squares in one-way frequency tables, you can specify the ONEWAYTABLE(CELLCHI2) option.
requests the Rao-Scott chi-square test. This is a design-adjusted test that is computed by applying a design correction to the weighted Pearson chi-square statistic. By default, PROC SURVEYFREQ provides a first-order Rao-Scott chi-square test. If you specify CHISQ(SECONDORDER), the procedure provides a second-order (Satterthwaite) Rao-Scott chi-square test. For more information, see the section Rao-Scott Chi-Square Test.
For one-way tables, the CHISQ option produces a design-based goodness-of-fit test. By default, this is a goodness-of-fit test for equal proportions. If you specify the null hypothesis proportions in the TESTP= option, the CHISQ option produces a chi-square goodness-of-fit test for the specified proportions.
By default for one-way tables, and for first-order tests for two-way tables, the design correction is computed from proportion estimates. If you specify CHISQ(MODIFIED), the design correction is computed from null hypothesis proportions. For second-order tests for two-way tables, the design correction is always computed from null hypothesis proportions.
You can specify the following options:
requests a first-order Rao-Scott chi-square test. This is the default for the CHISQ option; if you do not specify CHISQ(SECONDORDER), the procedure provides a first-order Rao-Scott test.
uses the null hypothesis proportions to compute the Rao-Scott design correction. By default (if you do not specify CHISQ(MODIFIED)), the procedure uses proportion estimates to compute the design correction for all first-order tests and for second-order tests for one-way tables. For second-order tests for two-way tables, the procedure always uses null hypothesis proportions to compute the design correction.
requests a second-order (Satterthwaite) Rao-Scott chi-square test. For more information, see the section Rao-Scott Chi-Square Test.
requests confidence limits for the percentages (proportions) in frequency and crosstabulation tables. You can use cl-options to specify the confidence limit type and computational details. You can specify the confidence level in the ALPHA= option. By default, ALPHA=0.05, which produces 95% confidence limits.
PROC SURVEYFREQ provides the following design-based confidence limit types for percentages: Agresti-Coull, Clopper-Pearson (exact), Jeffreys, logit, uniform, Wald, and Wilson (score). By default, PROC SURVEYFREQ computes Wald-type ("linear") confidence limits by using the variance estimates that are based on the sample design. For more information, see the section Confidence Limits for Proportions. You can specify the PSMALL or NSMALL= option to request a different confidence limit type for table cells that have small percentages or frequencies, respectively.
The CL option requests confidence limits for all percentages that you include in the crosstabulation table. To request confidence limits for only row or column percentages, you can specify the ROW(CL) or COLUMN(CL) option, respectively. To suppress confidence limits for row or column percentages, you can specify the ROW(CL=NO) or COLUMN(CL=NO) option, respectively.
You can specify the following cl-options:
controls the degrees-of-freedom adjustment to the effective sample size in the computation of modified confidence limits (Agresti-Coull, Clopper-Pearson, Jeffreys, uniform, and Wilson). For more information, see the subsection Degrees-of-Freedom Adjustment in the section Modified Confidence Limits.
By default, ADJUST=YES, which adjusts the effective sample size by using the Korn and Graubard (1998) adjustment factor. If you specify ADJUST=DP, PROC SURVEYFREQ uses the Dean and Pagano (2015) adjustment factor. If you specify ADJUST=NO, the effective sample size is not adjusted.
requests an alternative confidence limit type for table cells that have small frequencies. When the (unweighted) table cell frequency is less than or equal to n, PROC SURVEYFREQ computes the confidence limit type that you specify in the TYPE= cl-option. When the table cell frequency is greater than n, PROC SURVEYFREQ computes Wald confidence limits.
The frequency value n must be a positive integer. The NSMALL= option is available when you specify the TYPE=CLOPPERPEARSON, TYPE=LOGIT, or TYPE=WILSON cl-option. For more information, see the section Confidence Limits for Proportions.
requests an alternative confidence limit type for extreme (small and large) proportions. When the proportion estimate is less than or equal to p or greater than or equal to (1 – p), PROC SURVEYFREQ computes the confidence limit type that you specify in the TYPE= cl-option. When the proportion estimate is between p and (1 – p), PROC SURVEYFREQ computes Wald confidence limits.
By default, p=0.25; when the proportion estimate is less than or equal to 0.25 or greater than or equal to 0.75, PROC SURVEYFREQ computes the alternative confidence limit type. When the proportion estimate is between 0.25 and 0.75, PROC SURVEYFREQ computes Wald confidence limits.
The value of p must be a nonnegative number. You can specify p as a proportion between 0 and 0.5. Or you can specify p in percentage form as a number between 1 and 50, and PROC SURVEYFREQ converts that number to a proportion. The procedure treats the value 1 as the percentage form 1%.
The PSMALL cl-option is available when you specify the TYPE=CLOPPERPEARSON, TYPE=LOGIT, or TYPE=WILSON cl-option. For more information, see the section Confidence Limits for Proportions.
controls the truncation of the effective sample size in the computation of modified confidence limits (Agresti-Coull, Clopper-Pearson, Jeffreys, uniform, and Wilson). By default, TRUNCATE=YES truncates the effective sample size if it is larger than the original sample size. If you specify TRUNCATE=NO, the effective sample size is not truncated. For more information, see the subsection Truncation in the section Modified Confidence Limits.
specifies the type of confidence limits to compute for proportions. By default, PROC SURVEYFREQ computes Wald confidence limits (TYPE=WALD).
If you specify the PSMALL cl-option, the procedure computes the specified confidence limit type for extreme (small and large) proportions and computes Wald confidence limits otherwise. If you specify the NSMALL=n cl-option, the procedure computes the specified confidence limit type when the table cell frequency is less than or equal to n. If you omit the PSMALL and NSMALL= cl-options, PROC SURVEYFREQ computes the confidence limit type that you specify for all proportions.
You can specify one of the following confidence limit types:
requests modified Agresti-Coull confidence limits for proportions. For more information, see the section Modified Agresti-Coull Confidence Limits.
requests modified Clopper-Pearson (exact) confidence limits for proportions. For more information, see the section Modified Clopper-Pearson Confidence Limits.
requests modified Jeffreys confidence limits for proportions. For more information, see the section Modified Jeffreys Confidence Limits.
requests logit confidence limits for proportions. For more information, see the section Logit Confidence Limits.
requests modified uniform confidence limits for proportions. For more information, see the section Modified Uniform Confidence Limits.
requests Wald ("linear") confidence limits for proportions. This is the default confidence limit type if you do not specify the TYPE= option. For more information, see the section Wald Confidence Limits.
requests modified Wilson (score) confidence limits for proportions. For more information, see the section Modified Wilson Confidence Limits.
uses the number of observations (n) as the divisor in the simple random sampling (SRS) variance component of the design effect for modified confidence limits. By default, PROC SURVEYFREQ uses (n – 1) as the divisor. For more information, see the section Design Effect.
This option applies only to design effects that are used to compute effective sample sizes for modified confidence limits (Agresti-Coull, Clopper-Pearson, Jeffreys, uniform, and Wilson). For more information, see the subsection Effective Sample Size in the section Modified Confidence Limits. To control the divisor for all design effects that PROC SURVEYFREQ computes, you can specify the VARDEF=N option in the PROC SURVEYFREQ statement.
requests confidence limits for the weighted frequencies (totals) in the crosstabulation table. You can specify the confidence level in the ALPHA= option. By default, ALPHA=0.05, which produces 95% confidence limits. For more information, see the section Confidence Limits for Totals.
displays the column percentage (estimated proportion of the column total) for each cell in a two-way table. This option also provides standard errors of the column percentages. For more information, see the section Row and Column Proportions. This option has no effect on one-way frequency tables.
You can specify the following column-options:
requests confidence limits for the column percentages (proportions). For more information, see the section Confidence Limits for Proportions.
You can specify the confidence level in the ALPHA= option. By default, ALPHA=0.05, which produces 95% confidence limits.
You can specify the CL=NO column-option to suppress the display of confidence limits for column percentages (while displaying confidence limits for other percentages). By default, the overall CL option controls the display of confidence limits for all percentages (overall, row, and column percentages).
You can specify cl-options to control the confidence limit computations. The COLUMN cl-options are the same cl-options that are available for the overall CL option, which requests confidence limits for all percentages (overall, row, and column percentages). For a description of the cl-options, see the overall CL option. In a single TABLES statement, PROC SURVEYFREQ accepts only one value of each cl-option; for example, you cannot specify one TYPE= value for the overall CL option and a different TYPE= value for the COLUMN(CL) option.
displays coefficients of variation for the column percentages. For more information, see the section Coefficient of Variation.
You can specify the CV=NO column-option to suppress the display of coefficients of variation for column percentages (while displaying coefficients of variation for other percentages). By default, the overall CV option controls display of coefficients of variation for all percentages (overall, row, and column percentages).
displays design effects for the column percentages. For more information, see the section Design Effect.
suppresses the display of standard errors for column percentages.
displays variance estimates for the column percentages. For more information, see the section Proportions.
You can specify the VAR=NO column-option to suppress the display of variances estimates for column percentages (while displaying variance estimates for other percentages). By default, the overall VAR option controls the display of variance estimates for all percentages (overall, row, and column percentages).
requests the covariance matrix of the table cell frequency estimates. For more information, see the section Covariances of Frequency Estimates.
displays the coefficient of variation for each percentage (proportion) estimate in the crosstabulation table. For more information, see the section Coefficient of Variation.
To display coefficients of variation only for row or column percentages, you can specify the ROW(CV) or COLUMN(CV) option, respectively.
displays the coefficient of variation for each weighted frequency (estimated total), in the crosstabulation table. For more information, see the section Coefficient of Variation.
displays the design effect for each overall percentage (proportion) estimate in the crosstabulation table. For more information, see the section Design Effect.
To include or exclude the finite population correction (fpc) in the simple random sampling (SRS) component of the design effect, you can specify the DEFF(FPC=) option in the PROC SURVEYFREQ statement.
To use n instead of (n – 1) as the divisor in the SRS component of the design effect, you can specify the DEFF(VARDEF=N) option in the PROC SURVEYFREQ statement.
To display design effects for row or column percentages, you can specify the ROW(DEFF) or COLUMN(DEFF) option, respectively.
displays the deviations of the weighted frequencies from the expected weighted frequencies (weighted frequency – expected) in the crosstabulation table. The expected weighted frequencies are computed under the null hypothesis that the row and column variables are independent. You can display the expected values by specifying the EXPECTED option. For more information, see the section Expected Weighted Frequency.
This option has no effect on one-way frequency tables. To display deviations in one-way frequency tables, you can specify the ONEWAYTABLE(DEVIATION) option.
specifies the degrees of freedom for the analysis. The value of df must be a nonnegative number. By default, PROC SURVEYFREQ computes the degrees of freedom as described in the section Degrees of Freedom.
PROC SURVEYFREQ uses the value df to obtain the t distribution’s percentile for confidence limits for proportions, totals, and other statistics. For more information, see the section Confidence Limits for Proportions. PROC SURVEYFREQ also uses df to compute the denominator degrees of freedom for the F statistics in the Rao-Scott and Wald chi-square tests. For more information, see the sections Rao-Scott Chi-Square Test, Rao-Scott Likelihood Ratio Chi-Square Test, Wald Chi-Square Test, and Wald Log-Linear Chi-Square Test.
requests the difference between discordant proportions for tables. This option displays the discordant proportion difference together with its standard error, confidence limits, and t test. For more information, see the section Discordant Proportion Difference.
You can specify the confidence level in the ALPHA= option. By default, ALPHA=0.05, which produces 95% confidence limits.
displays a separate one-way frequency table for each row variable level in a two-way or multiway crosstabulation. Each one-way frequency table provides the distribution of the column (last) variable in the domain that is defined by the row variable level (together with the layer variable levels if the crosstabulation is multiway). The percentages, standard errors, confidence limits, and other statistics in a DOMAIN=ROW one-way frequency table are the same values that you can display in the corresponding two-way table by specifying the ROW option. For more information, see the sections Domain Analysis and Row and Column Proportions.
All display and statistic options that apply to general one-way table analysis are available for DOMAIN=ROW one-way table analysis. When you specify the DOMAIN=ROW option, the CHISQ and LRCHISQ options produce one-way chi-square tests for the row-level domains. You can specify null proportions for these chi-square tests in the TESTP= option.
displays the expected weighted frequencies for the cells in the crosstabulation table. The expected weighted frequencies are computed under the null hypothesis that the row and column variables are independent. For more information, see the section Expected Weighted Frequency.
This option has no effect on one-way frequency tables. To display expected weighted frequencies in one-way frequency tables, you can specify the ONEWAYTABLE(EXPECTED) option.
requests the simple kappa coefficient with its standard error and confidence limits. The kappa coefficient can be computed for square two-way tables, where the number of rows equals the number of columns. For more information, see the section Simple Kappa Coefficient.
You can specify the confidence level in the ALPHA= option. By default, ALPHA=0.05, which produces 95% confidence limits.
The kappa coefficient is available for replication variance estimation methods (which you can request by specifying VARMETHOD=BOOTSTRAP, VARMETHOD=BRR, or VARMETHOD=JACKKNIFE or by including a REPWEIGHTS statement); the kappa coefficient is not available for the Taylor series method (VARMETHOD=TAYLOR).
You can specify the following option:
displays the "Kappa Details" table, which includes the following statistics: observed agreement, chance-expected agreement, maximum possible kappa, and the measure. If the two-way table is
, the "Kappa Details" table also includes the prevalence index and the bias index. For more information, see the section Simple Kappa Coefficient.
requests the Rao-Scott likelihood ratio chi-square test. This is a design-adjusted test that is computed by applying a design correction to the weighted likelihood ratio chi-square statistic. By default, PROC SURVEYFREQ provides a first-order Rao-Scott likelihood ratio test. If you specify LRCHISQ(SECONDORDER), the procedure provides a second-order (Satterthwaite) Rao-Scott likelihood ratio test. For more information, see the section Rao-Scott Likelihood Ratio Chi-Square Test.
For one-way tables, the LRCHISQ option produces a design-based likelihood ratio goodness-of-fit test. By default, the null hypothesis is equal proportions. If you specify null hypothesis proportions in the TESTP= option, the LRCHISQ option produces a design-based likelihood ratio test for the specified proportions.
By default for one-way tables, and for first-order tests for two-way tables, the design correction is computed from proportion estimates. If you specify LRCHISQ(MODIFIED), the design correction is computed from null hypothesis proportions. For second-order tests for two-way tables, the design correction is always computed from null hypothesis proportions.
You can specify the following options:
requests a first-order Rao-Scott likelihood ratio test. This is the default for the LRCHISQ option; if you do not specify LRCHISQ(SECONDORDER), the procedure provides a first-order Rao-Scott test.
uses the null hypothesis proportions to compute the Rao-Scott design correction. By default (if you do not specify LRCHISQ(MODIFIED)), the procedure uses proportion estimates to compute the design correction for all first-order tests and for second-order tests for one-way tables. For second-order tests for two-way tables, the procedure always uses null hypothesis proportions to compute the design correction.
requests a second-order (Satterthwaite) Rao-Scott likelihood ratio test. For more information, see the section Rao-Scott Likelihood Ratio Chi-Square Test.
suppresses the display of overall cell percentages (and their standard errors) in the crosstabulation table. This option does not suppress the display of row or column percentages, which you can request by specifying the ROW or COLUMN option.
suppresses the display of cell frequencies in the crosstabulation table. The NOFREQ option also suppresses the display of row, column, and overall table frequencies.
suppresses the display of all percentages in the crosstabulation table. The NOPERCENT option also suppresses the display of standard errors of the percentages. You can use the NOCELLPERCENT option to suppress display of overall cell percentages but allow display of row or column percentages.
suppresses the display of frequency and crosstabulation tables but displays all requested statistical tests. This option disables the Output Delivery System (ODS) for the suppressed tables. For more information, see Chapter 23, Using the Output Delivery System.
suppresses the display of zero-frequency variable levels in two-way tables. By default, PROC SURVEYFREQ displays all levels of the column variable within each level of the row variable, including any column variable levels that have frequencies of 0 in the row. By default for multiway tables, PROC SURVEYFREQ displays all levels of the row variable within each layer of the table, including any row variable levels that have frequencies of 0 in the layer.
suppresses the display of all standard errors in the crosstabulation table.
suppresses the display of row totals, column totals, and overall totals in the crosstabulation table.
suppresses the display of weighted frequencies in the crosstabulation table. The NOWT option also suppresses the display of standard errors of the weighted frequencies.
displays additional statistics in one-way frequency tables. For more information about the contents of one-way frequency tables, see the section One-Way Frequency Tables.
You can specify the following options:
displays each table cell’s contribution to the Pearson chi-square statistic in the one-way frequency table. The cell chi-square is computed as , where
is the weighted frequency of the table cell and
is the expected weighted frequency under the null hypothesis of the chi-square test. For more information, see the subsection One-Way Tables in the section Rao-Scott Chi-Square Test.
You can display the expected weighted frequencies by specifying the ONEWAYTABLE(EXPECTED) option, and you can display the deviations by specifying the ONEWAYTABLE(DEVIATION) option.
displays the deviation of the weighted frequency from the expected weighted frequency () for each level (cell) in the one-way frequency table, where
is the expected weighted frequency under the null hypothesis of the chi-square test. For more information, see the subsection One-Way Tables in the section Rao-Scott Chi-Square Test. You can display the expected weighted frequencies by specifying the ONEWAYTABLE(EXPECTED) option.
displays the expected weighted frequency for each level (cell) in the one-way frequency table. The expected weighted frequencies are computed under the null hypothesis of the chi-square test. By default, the expected weighted frequency for each level is the total weighted frequency divided by the number of levels. Alternatively, the expected weighted frequencies are computed by using the null hypothesis proportions that you provide in the TESTP= option. For more information, see the subsection One-Way Tables in the section Rao-Scott Chi-Square Test.
displays the Pearson residual for each level (cell) in the one-way frequency table. The Pearson residual is the square root of the level’s contribution to the Pearson chi-square statistic. The Pearson residual is computed as , where
is the weighted frequency of the level and
is the expected weighted frequency of the level under the null hypothesis of the chi-square test. For more information, see the subsection One-Way Tables in the section Rao-Scott Chi-Square Test.
requests estimates of the odds ratio, the column 1 relative risk, and the column 2 relative risk for tables. The OR option also provides confidence limits for these statistics. For more information, see the section Odds Ratio and Relative Risks.
You can specify the confidence level in the ALPHA= option. By default, ALPHA=0.05, which produces 95% confidence limits.
displays each crosstabulation table cell’s Pearson residual, which is the square root of the table cell’s contribution to the Pearson chi-square statistic. The Pearson residual is computed as , where
is the weighted frequency of the table cell and
is the expected weighted frequency, which is computed under the null hypothesis that the row and column variables are independent. You can display the expected values, the deviations, and the cell chi-squares by specifying the EXPECTED, DEVIATION, and CELLCHI2 options, respectively. For more information, see the sections Expected Weighted Frequency and Rao-Scott Chi-Square Test.
This option has no effect on one-way frequency tables. To display Pearson residuals in one-way frequency tables, you can specify the ONEWAYTABLE(PEARSONRES) option.
controls the plots that are produced through ODS Graphics. Plot-requests identify the plots, and plot-options control the appearance and content of the plots. You can specify plot-options in parentheses after a plot-request. A global-plot-option applies to all plots for which it is available unless it is altered by a specific plot-option. You can specify global-plot-options in parentheses after the PLOTS option.
When you specify only one plot-request, you can omit the parentheses around the plot-request. For example:
plots=all
plots=wtfreqplot
plots=(wtfreqplot oddsratioplot)
plots(only)=(riskdiffplot relriskplot)
ODS Graphics must be enabled before plots can be requested. For example:
ods graphics on;
proc surveyfreq;
tables treatment*response / chisq plots=wtfreqplot;
weight wt;
run;
ods graphics off;
For more information about enabling and disabling ODS Graphics, see the section Enabling and Disabling ODS Graphics in Chapter 24, Statistical Graphics Using ODS.
If ODS Graphics is enabled but you do not specify the PLOTS= option, PROC SURVEYFREQ produces all plots that are associated with the analyses that you request, with the exception of weighted frequency plots and mosaic plots. To produce a weighted frequency plot or mosaic plot when ODS Graphics is enabled, you must specify the WTFREQPLOT or MOSAICPLOT plot-request, or you must specify the PLOTS=ALL option. PROC SURVEYFREQ produces the remaining plots (listed in Table 5) by default when you request the corresponding TABLES statement options.
You can suppress default plots and request specific plots by using the PLOTS(ONLY)= option; PLOTS(ONLY)=(plot-requests) produces only the plots that are specified as plot-requests. You can suppress all plots by specifying the PLOTS=NONE option.
See Figure 4 and Figure 7 for examples of plots that PROC SURVEYFREQ produces. For information about ODS Graphics, see Chapter 24, Statistical Graphics Using ODS.
Plot Requests
Table 5 lists the available plot-requests together with their required TABLES statement options. Descriptions of the plot-requests follow the table in alphabetical order.
Table 5: Plot Requests
| Plot Request | Description | Required TABLES Statement Option |
|---|---|---|
| ALL | All plots | None |
| KAPPAPLOT | Kappa plot | AGREE or KAPPA ( |
| MOSAICPLOT | Mosaic plot | Crosstabulation table request |
| NONE | No plots | None |
| ODDSRATIOPLOT | Odds ratio plot | OR ( |
| RELRISKPLOT | Relative risk plot | OR ( |
| RISKDIFFPLOT | Risk difference plot | RISK or RISKDIFF, ( |
| WTFREQPLOT | Weighted frequency plot | Frequency or crosstabulation table request |
| WTKAPPAPLOT | Weighted kappa plot | AGREE or WTKAPPA ( |
You can specify the following plot-requests:
requests all plots that are associated with the specified analyses. If you specify the PLOTS=ALL option, PROC SURVEYFREQ also produces the weighted frequency and mosaic plots that are associated with the tables that you request. (PROC SURVEYFREQ does not produce weighted frequency and mosaic plots by default when ODS Graphics is enabled.)
requests a plot of kappa coefficients with confidence limits. Kappa plots are available for multiway square tables and display the simple kappa coefficient (with confidence limits) for each two-way table layer. To produce a kappa plot, you must specify the KAPPA or AGREE option in the TABLES statement to compute kappa coefficients.
Table 6 lists the plot-options that are available for kappa plots. For descriptions of the plot-options, see the subsection "Plot Options."
Table 6: Plot Options for KAPPAPLOT and WTKAPPAPLOT
| Plot Option | Description | Values |
|---|---|---|
| CLDISPLAY= | Error bar type | BAR, LINE, LINEARROW, |
| SERIF |
||
| NPANELPOS= | Statistics per graphic | Number (All |
| ORDER= | Order of two-way levels | ASCENDING or DESCENDING |
| RANGE= | Range to display | Values or CLIP |
| STATS | Statistic values | None |
|
|
||
requests a mosaic plot. Mosaic plots are available for crosstabulation tables. For multiway tables, PROC SURVEYFREQ provides a mosaic plot for each two-way table layer.
To produce a mosaic plot, you must specify the MOSAICPLOT plot-request in the PLOTS= option, or you must specify the PLOTS=ALL option. PROC SURVEYFREQ does not produce mosaic plots by default when ODS Graphics is enabled.
Mosaic plots display tiles that correspond to the crosstabulation table cells. The areas of the tiles are proportional to the weighted frequencies of the table cells. The column variable is displayed on the X axis, and the tile widths are proportional to the relative weighted frequencies of the column variable levels. The row variable is displayed on the Y axis, and the tile heights are proportional to the relative weighted frequencies of the row levels within column levels. For more information, see Friendly (2000).
By default, the colors of the tiles correspond to the row variable levels. If you specify the COLORSTAT plot-option, the tiles are colored according to the values of the Pearson residuals.
You can specify the following plot-options:
colors the mosaic plot tiles according to the values of the Pearson residuals. A table cell’s Pearson residual is the square root of its contribution to the Pearson chi-square statistic. The Pearson residual is computed as , where weighted frequency is the weighted frequency of the table cell and expected is the expected weighted frequency. You can specify the PEARSONRES option to display the Pearson residuals in the crosstabulation table.
produces a square mosaic plot, where the height of the Y axis equals the width of the X axis. In a square mosaic plot, the scale of the relative weighted frequencies is the same on both axes. By default, PROC SURVEYFREQ produces a rectangular mosaic plot.
requests a plot of odds ratios with confidence limits. Odds ratio plots are available for multiway tables and display the odds ratio (with confidence limits) for each
table layer. To produce an odds ratio plot, you must specify the OR option in the TABLES statement for a multiway
table.
Table 7 lists the plot-options that are available for odds ratio plots. For descriptions of the plot-options, see the subsection "Plot Options."
Table 7: Plot Options for ODDSRATIOPLOT, RELRISKPLOT, and RISKDIFFPLOT
| Plot Option | Description | Values |
|---|---|---|
| CLDISPLAY= | Error bar type | BAR, LINE, LINEARROW, |
| SERIF |
||
|
COLUMN= |
Risk column | 1 |
|
LOGBASE= |
Axis scale | 2, E, or 10 |
| NPANELPOS= | Statistics per graphic | Number (All |
| ORDER= | Order of two-way levels | ASCENDING or DESCENDING |
| RANGE= | Range to display | Values or CLIP |
| STATS | Statistic values | None |
|
|
||
|
|
||
|
|
||
requests a plot of relative risks with confidence limits. Relative risk plots are available for multiway tables and display the relative risk (with confidence limits) for each
table layer. To produce a relative risk plot, you must specify the OR option in the TABLES statement for a multiway
table.
Table 7 lists the plot-options that are available for relative risk plots. For descriptions of the plot-options, see the subsection "Plot Options."
requests a plot of risk differences with confidence limits. Risk difference plots are available for multiway tables and display the risk difference (with confidence limits) for each
table layer. To produce a risk difference plot, you must specify the RISK or RISKDIFF option in the TABLES statement for a multiway
table.
Table 7 lists the plot-options that are available for risk difference plots. For descriptions of the plot-options, see the subsection "Plot Options."
requests a weighted frequency plot. Weighted frequency plots are available for frequency and crosstabulation tables. For multiway tables, PROC SURVEYFREQ provides a two-way weighted frequency plot for each two-way table layer.
To produce a weighted frequency plot, you must specify the WTFREQPLOT plot-request in the PLOTS= option, or you must specify the PLOTS=ALL option. PROC SURVEYFREQ does not produce weighted frequency plots by default when ODS Graphics is enabled.
By default, PROC SURVEYFREQ displays weighted frequency plots as bar charts. You can specify the TYPE=DOTPLOT plot-option to display frequency plots as dot plots. You can plot weighted percentages instead of frequencies by specifying the SCALE=PERCENT plot-option. There are four frequency plot layouts available, which you can request by specifying the TWOWAY= plot-option. For more information, see the subsection "Plot Options."
By default, the primary grouping of graph cells in a two-way layout is by column variable. Row variable levels are then displayed within column variable levels. You can specify the GROUPBY=ROW plot-option to group first by row variable.
Weighted frequency plots for one-way tables display confidence limits by default. For two-way tables, weighted frequency plots display confidence limits by default in the TWOWAY=GROUPVERTICAL and TWOWAY=GROUPHORIZONTAL layouts. You can suppress confidence limits by specifying the CLBAR=NO plot-option. Confidence limits are not available for two-way plots in the TWOWAY=CLUSTER and TWOWAY=STACKED layouts.
Table 8 lists the plot-options that are available for weighted frequency plots. For descriptions of the plot-options, see the subsection "Plot Options."
Table 8: Plot Options for WTFREQPLOT
| Plot Option | Description | Values |
|---|---|---|
| CLBAR= | Confidence limit bars | NO or YES |
|
GROUPBY= |
Primary group | COLUMN |
|
NPANELPOS= |
Sections per panel | Number (4 |
| ORIENT= | Orientation | HORIZONTAL or VERTICAL |
| SCALE= | Scale | PERCENT or WTFREQ |
|
TWOWAY= |
Two-way layout | CLUSTER, GROUPHORIZONTAL, |
| GROUPVERTICAL |
||
| TYPE= | Type | BARCHART |
|
|
||
|
|
requests a plot of weighted kappa coefficients with confidence limits. Weighted kappa plots are available for multiway square tables and display the weighted kappa coefficient (with confidence limits) for each two-way table layer. To produce a weighted kappa plot, you must specify the WTKAPPA or AGREE option in the TABLES statement to compute weighted kappa coefficients, and the table dimension must be greater than 2.
Table 6 lists the plot-options that are available for weighted kappa plots. For descriptions of the plot-options, see the subsection "Plot Options."
Global Plot Options
A global-plot-option applies to all plots for which the option is available unless it is altered by an individual plot-option.
You can specify global-plot-options in parentheses after the PLOTS option. For example:
plots(order=ascending stats)=(riskdiffplot oddsratioplot)
plots(only)=wtfreqplot
You can specify any plot-option that is listed in Table 8 or Table 7 as a global-plot-option. In addition to these plot-options, you can specify the following global-plot-option:
suppresses the default plots and requests only the plots that are specified as plot-requests.
Plot Options
You can specify the following plot-options:
controls the confidence limit error bars in weighted frequency plots (WTFREQPLOT). By default, CLBAR=YES, which displays confidence limits error bars; CLBAR=NO suppresses confidence limit error bars.
This plot-option applies to all weighted frequency plots except those two-way plots that are displayed in the TWOWAY=CLUSTER or TWOWAY=STACKED layout. Confidence limit error bars are not available in the TWOWAY=CLUSTER and TWOWAY=STACKED layouts.
controls the appearance of the confidence limit error bars. This plot-option is available for the following plots: KAPPAPLOT, ODDSRATIOPLOT, RELRISKPLOT, RISKDIFFPLOT, and WTKAPPAPLOT.
By default, CLDISPLAY=SERIF, which displays the confidence limits as lines with serifs. CLDISPLAY=LINE displays the confidence limits as plain lines without serifs. The CLDISPLAY=SERIFARROW and CLDISPLAY=LINEARROW plot-options display arrowheads on any error bars that are clipped by the RANGE= plot-option; if an entire error bar is cut from the plot, the plot displays an arrowhead that points toward the statistic.
CLDISPLAY=BAR displays the confidence limits as bars. By default, the width of the bars equals the size of the marker for the estimate. You can control the width of the bars and the size of the marker by specifying the value of width as a percentage of the distance between bars, . The bar might disappear when the value of width is very small.
specifies the table column for which to compute the risks (proportions) for the relative risk plot (RELRISKPLOT) and the risk difference plot (RISKDIFFPLOT). If you specify COLUMN=1, the plot displays the column 1 relative risks or risk differences; if you specify COLUMN=2, the plot displays the column 2 relative risks or risk differences.
If you omit this option for the risk difference plot, the plot uses the table column that you specify for the risk difference statistics in the RISK(COLUMN=) or RISKDIFF(COLUMN=) option. If you omit these COLUMN= options, then by default, COLUMN=1 for the risk difference plot. For the relative risk plot, by default, COLUMN=1.
specifies the primary grouping for two-way weighted frequency plots, which you can request by specifying the WTFREQPLOT plot-request.
By default, GROUPBY=COLUMN, which groups graph cells first by column variable and displays row variable levels within column variable levels. You can specify GROUPBY=ROW to group first by row variable. In two-way and multiway table requests, the column variable is the last variable specified and forms the columns of the crosstabulation table. The row variable is the next-to-last variable specified and forms the rows of the table.
By default for a bar chart that is displayed in the TWOWAY=STACKED layout, bars correspond to the column variable levels and row levels are displayed (stacked) within each column bar. By default for a bar chart that is displayed in the TWOWAY=CLUSTER layout, bars are first grouped by column variable levels, and row levels are displayed as adjacent bars within each column-level group. You can reverse the default row and column variable groupings by specifying GROUPBY=ROW.
applies to the odds ratio plot (ODDSRATIOPLOT) and the relative risk plot (RELRISKPLOT). This plot-option displays the odds ratio or relative risk axis on the log scale that you specify.
divides the plot into multiple panels that display at most statistics or sections.
If n is positive, the number of statistics or sections per panel is balanced; if n is negative, the number of statistics per panel is not balanced. For example, suppose you want to display 21 odds ratios. NPANELPOS=20 displays two panels, the first with 11 odds ratios and the second with 10 odds ratios; NPANELPOS=–20 displays 20 odds ratios in the first panel but only 1 in the second panel. This plot-option is available for all plots except mosaic plots and one-way weighted frequency plots.
For two-way weighted frequency plots (WTFREQPLOT), NPANELPOS=n requests that panels display at most sections, where sections correspond to row or column variable levels, depending on the type of plot and the grouping. By default, n=4 and each panel includes at most four sections. This plot-option applies to two-way plots that are displayed in the TWOWAY=GROUPVERTICAL or TWOWAY=GROUPHORIZONTAL layout. The NPANELPOS= plot-option does not apply to the TWOWAY=CLUSTER and TWOWAY=STACKED layouts, which are always displayed in a single panel.
For plots that display statistics with confidence limits, NPANELPOS=n requests that panels display at most statistics. By default, n=0 and all statistics are displayed in a single panel. This plot-option applies to the following plots: KAPPAPLOT, ODDSRATIOPLOT, RELRISKPLOT, RISKDIFFPLOT, and WTKAPPAPLOT.
displays the two-way table (layer) statistics in order of the statistic value. If you specify ORDER=ASCENDING or ORDER=DESCENDING, the plot displays the statistics in ascending or descending order, respectively. By default, the order of the statistics in the plot matches the order that the two-way table layers appear in the multiway table.
This plot-option is available for the following plots: KAPPAPLOT, ODDSRATIOPLOT, RELRISKPLOT, RISKDIFFPLOT, and WTKAPPAPLOT.
controls the orientation of weighted frequency plots (WTFREQPLOT). This plot-option places the variable levels on the Y axis and the weighted frequencies or percentages on the X axis. ORIENT=VERTICAL places the variable levels on the X axis. The default orientation is ORIENT=VERTICAL for bar charts (TYPE=BARCHART) and ORIENT=HORIZONTAL for dot plots (TYPE=DOTPLOT).
specifies the range of values to display. If you specify RANGE=CLIP, the confidence limits are clipped and the display range is determined by the minimum and maximum values of the estimates. By default, the display range includes all confidence limits.
This plot-option is available for the following plots: KAPPAPLOT, ODDSRATIOPLOT, RELRISKPLOT, RISKDIFFPLOT, and WTKAPPAPLOT.
specifies the scale of the frequencies in weighted frequency plots (WTFREQPLOT). SCALE=WTFREQ displays weighted frequencies (totals), and SCALE=PERCENT displays percentages. The default scale is SCALE=WTFREQ.
displays the values of the statistics and their confidence limits on the right side of the plot. If you do not specify this plot-option, the statistic values are not displayed.
This plot-option is available for the following plots: KAPPAPLOT, ODDSRATIOPLOT, RELRISKPLOT, RISKDIFFPLOT, and WTKAPPAPLOT.
specifies the layout for two-way weighted frequency plots (WTFREQPLOT).
All TWOWAY= layouts are available for bar charts (TYPE=BARCHART). All TWOWAY= layouts except TWOWAY=CLUSTER are available for dot plots (TYPE=DOTPLOT). Confidence limits (CLBAR=) can be displayed in the GROUPVERTICAL and GROUPHORIZONTAL layouts. Confidence limits are not available in the STACKED and CLUSTER layouts. The ORIENT= and GROUPBY= plot-options are available for all TWOWAY= layouts.
The default two-way layout is TWOWAY=GROUPVERTICAL, which produces a grouped plot that has a vertical common baseline. By default for bar charts (TYPE=BARCHART, ORIENT=VERTICAL), the X axis displays column variable levels, and the Y axis displays weighted frequencies. The plot includes a vertical (Y-axis) block for each row variable level. The relative positions of the graph cells in this plot layout are the same as the relative positions of the table cells in the crosstabulation table. You can reverse the default row and column grouping by specifying the GROUPBY=ROW plot-option.
The TWOWAY=GROUPHORIZONTAL layout produces a grouped plot that has a horizontal common baseline. By default (GROUPBY=COLUMN), the plot displays a block on the X axis for each column variable level. Within each column-level block, the plot displays row variable levels.
The TWOWAY=STACKED layout produces stacked displays of weighted frequencies. By default (GROUPBY=COLUMN) in a stacked bar chart, the bars correspond to column variable levels, and row levels are stacked within each column level. By default in a stacked dot plot, the dotted lines correspond to column levels, and cell weighted frequencies are plotted as data dots on the corresponding column line. The dot color identifies the row level.
The TWOWAY=CLUSTER layout, which is available only for bar charts, displays groups of adjacent bars. By default, the primary grouping is by column variable level, and row levels are displayed within each column level.
You can reverse the default row and column grouping in any layout by specifying the GROUPBY=ROW plot-option. By default, GROUPBY=COLUMN, which groups first by column variable.
specifies the type (form) of the weighted frequency plots (WTFREQPLOT). TYPE=BARCHART produces a bar chart and TYPE=DOTPLOT produces a dot plot. The default type is TYPE=BARCHART.
requests risk statistics for tables. Risk statistics include the row 1 risk (proportion of row 1), row 2 risk, overall risk, and risk difference (row 1 risk – row 2 risk), together with their standard errors and confidence limits. For more information, see the section Risks and Risk Difference.
You can specify the confidence level in the ALPHA= option. By default, ALPHA=0.05, which produces 95% confidence limits. To display only the risk difference (and suppress display of the row 1, row 2, and overall risks), you can specify the RISKDIFF(ONLY) option.
You can specify the following option:
specifies the table column for which to compute the risk statistics. By default, COLUMN=BOTH.
requests risk statistics for tables. By default, risk statistics include the row 1 risk (proportion of row 1), row 2 risk, overall risk, and risk difference (row 1 risk – row 2 risk), together with their standard errors and confidence limits. For more information, see the section Risks and Risk Difference.
You can specify the confidence level in the ALPHA= option. By default, ALPHA=0.05, which produces 95% confidence limits.
You can specify the following options:
specifies the table column for which to compute the risk statistics. By default, COLUMN=BOTH.
displays only the risk difference together with its standard error and confidence limits. This option suppresses display of the row 1 risk, row 2 risk, and overall risk.
displays the row percentage (estimated proportion of the row total) for each cell in a two-way table. This option also provides the standard errors of the row percentages. For more information, see the section Row and Column Proportions. This option has no effect on one-way frequency tables.
To display the row percentages and statistics in separate one-way tables for each row (instead of in a two-way table), you can specify the DOMAIN=ROW option.
You can specify the following row-options:
requests confidence limits for the row percentages (proportions). For more information, see the section Confidence Limits for Proportions.
You can specify the confidence level in the ALPHA= option. By default, ALPHA=0.05, which produces 95% confidence limits.
You can specify the CL=NO row-option to suppress the display of confidence limits for row percentages (while displaying confidence limits for other percentages). By default, the overall CL option controls display of confidence limits for all percentages (overall, row, and column percentages).
You can specify cl-options to control the confidence limit computations. The ROW cl-options are the same cl-options that are available for the overall CL option, which requests confidence limits for all percentages (table cell, row, and column percentages). For a description of the cl-options, see the overall CL option. For more information, see the section Confidence Limits for Proportions. In a single TABLES statement, PROC SURVEYFREQ accepts only one value of each cl-option; for example, you cannot specify one TYPE= value in the overall CL option and a different TYPE= value in the ROW(CL) option.
displays coefficients of variation for the row percentages. For more information, see the section Coefficient of Variation.
You can specify the CV=NO row-option to suppress the display of coefficients of variation for row percentages (while displaying coefficients of variation for other percentages). By default, the overall CV option controls display of coefficients of variation for all percentages (overall, row, and column percentages).
displays design effects for the row percentages. For more information, see the section Design Effect.
suppresses the display of standard errors for the row percentages.
displays variance estimates for the row percentages. For more information, see the section Proportions.
You can specify the VAR=NO row-option to suppress the display of variances estimates for row percentages (while displaying variances estimates for other percentages). By default, the overall VAR option controls display of variance estimates for all percentages (overall, row, and column percentages).
requests estimates of sensitivity, specificity, accuracy, positive predictive value, and negative predictive value for tables. The "Sensitivity and Specificity" table provides these estimates together with their standard errors and confidence limits. For more information, see the section Sensitivity and Specificity.
You can specify the confidence level in the ALPHA= option. By default, ALPHA=0.05, which produces 95% confidence limits.
You can specify the following options:
controls the footnote that identifies the reference level (true positives) in the "Sensitivity and Specificity" table. NOTE=NO suppresses this footnote and NOTE<=YES> displays it. By default, PROC SURVEYFREQ displays the footnote only when you specify the reference level by using the REFCELL=, REFCOLUMN=, and/or REFROW= options.
specifies the table cell to use as the true-positive classification (positive row variable level and positive column variable level) in the SENSPEC computations. For more information, see the section Sensitivity and Specificity.
You can specify the true-positive cell number as 1, 2, 3, or 4; these numbers correspond to the cells of the crosstabulation table. By default, REFCELL=1, which uses table cell (1,1) as the true-positive cell (and the corresponding row 1 and column 1 as the positive row and column levels, respectively). REFCELL=2, 3, and 4 use table cells (1,2), (2,1), and (2,2), respectively, as the true-positive cells.
You cannot specify this option together with the REFROW= or REFCOLUMN= option. The true-positive cell number determines the corresponding positive row and column levels.
specifies the column level to use as the positive column level in the SENSPEC computations. For more information, see the section Sensitivity and Specificity.
You can specify the positive column level number as 1 or 2, which is the order in which the level appears in the crosstabulation table. Or you can specify the positive column level-value, which is the formatted value of the level. The level-value must be enclosed in single quotes. By default, REFCOLUMN=1.
specifies the row level to use as the positive row level in the SENSPEC computations. For more information, see the section Sensitivity and Specificity.
You can specify the positive row level number as 1 or 2, which is the order in which the level appears in the crosstabulation table. Or you can specify the positive row level-value, which is the formatted value of the level. The level-value must be enclosed in single quotes. By default, REFROW=1.
specifies null hypothesis proportions (test percentages) for chi-square tests for one-way tables (goodness-of-fit tests). You can separate values with blanks or commas, and you must enclose the list of values in parentheses. Specify values in probability form as numbers between 0 and 1, where the proportions sum to 1. Or specify values in percentage form as numbers between 0 and 100, where the percentages sum to 100. PROC SURVEYFREQ treats the value 1 as the percentage form 1%. The number of TESTP= values must equal the number of variable levels in the one-way table. List these values in the same order in which the corresponding variable levels appear in the output.
When you specify the TESTP= option, PROC SURVEYFREQ displays the specified test percentages in the one-way frequency table. The TESTP= option has no effect on two-way tables.
PROC SURVEYFREQ uses the TESTP= values for the one-way Rao-Scott chi-square test (CHISQ) and for the one-way Rao-Scott likelihood ratio chi-square test (LRCHISQ). For more information, see the sections Rao-Scott Chi-Square Test and Rao-Scott Likelihood Ratio Chi-Square Test.
displays the variance estimate for each percentage in the crosstabulation table. For more information, see the section Proportions. By default, PROC SURVEYFREQ displays the standard errors of the percentages.
To display variance estimates only for row or column percentages, specify the ROW(VAR) or COLUMN(VAR) option, respectively.
displays the variance estimate for each weighted frequency, or estimated total, in the crosstabulation table. For more information, see the section Totals. By default, PROC SURVEYFREQ displays the standard errors of the weighted frequencies.
requests the Wald chi-square test for two-way tables. For more information, see the section Wald Chi-Square Test.
requests the Wald log-linear chi-square test for two-way tables. For more information, see the section Wald Log-Linear Chi-Square Test.
displays totals (weighted frequencies) and their standard errors when you do not specify a WEIGHT or REPWEIGHTS statement. By default, PROC SURVEYFREQ displays the weighted frequencies only when you specify a WEIGHT or REPWEIGHTS statement. When you do not specify a WEIGHT or REPWEIGHTS statement, PROC SURVEYFREQ assigns all observations a weight of one.
requests the weighted kappa coefficient with its standard error and confidence limits. Weighted kappa coefficients can be computed for square two-way tables, where the number of rows is the same as the number of columns. For tables, the weighted kappa coefficient equals the simple kappa coefficient, and PROC SURVEYFREQ displays only the simple kappa coefficient. For more information, see the section Weighted Kappa Coefficient.
You can specify the confidence level in the ALPHA= option. By default, ALPHA=0.05, which produces 95% confidence limits.
Weighted kappa coefficients are available for replication variance estimation methods (which you can request by specifying VARMETHOD=BOOTSTRAP, VARMETHOD=BRR, or VARMETHOD=JACKKNIFE or by including a REPWEIGHTS statement); weighted kappa coefficients are not available for the Taylor series method (VARMETHOD=TAYLOR).
Weighted kappa coefficients are computed by using agreement weights that reflect the relative agreement between pairs of variable levels. Agreement weights are not the same as sampling weights, which you provide by specifying the WEIGHT statement. PROC SURVEYFREQ uses the sampling weights to compute both the simple kappa and weighted kappa coefficients. For more information, see the section Weighted Kappa Coefficient.
You can specify the following options:
displays the observed agreement and chance-expected agreement components of the weighted kappa coefficient. For more information, see the section Weighted Kappa Coefficient.
displays the agreement weights that PROC SURVEYFREQ uses to compute the weighted kappa coefficient. Agreement weights reflect the relative agreement between pairs of variable levels. By default, PROC SURVEYFREQ computes these weights by using the Cicchetti-Allison form. If you specify the WT=FC option, the procedure uses the Fleiss-Cohen form of agreement weights. For more information, see the section Weighted Kappa Coefficient.
requests Fleiss-Cohen agreement weights for the weighted kappa computation. By default, PROC SURVEYFREQ uses Cicchetti-Allison agreement weights to compute the weighted kappa coefficient. Agreement weights reflect the relative agreement between pairs of variable levels. For more information, see the section Weighted Kappa Coefficient.