SUDAAN 11 Examples

WTADJUST Examples

Produces nonresponse and poststratification sample weight adjustments using a calibration approach to selection modeling (when there is nonresponse or known coverage errors) and sample balancing.
Examples Illustrates Datasets Used
WTADJUST Example 1 MODEL, WTMIN, WTMAX, LOWERBD, UPPERBD See SAS code within the example
WTADJUST Example 2 REFLEVEL, WTMAX, SETENV, UPPERBD, LOWERBD samadult.SAS7bdat
WTADJUST Example 3 CENTER, POSTWGT, WTMIN, WTMAX, CLASS demo_d2.xpt
WTADJUST Example 4 VPAIRWISE, CLASS, PREDSTAT, NEST2, MODEL See SAS code within the example

WTADJX Examples

(includes standard errors from WTADJUST and nonresponse adjustment with RLOGIST)
New in Release 11. As in WTADJUST, WTADJX produces nonresponse and post-stratification weighting adjustments using a calibration approach to selection modeling and sample balancing. In WTADJX, however, the variables used in the selection or weight-adjustment model need not be the same as the calibration variables.
Examples Illustrates Datasets Used
WTADJX Example 1
(also includes standard errors for WTADJUST)
Raking, raking to a size variable, quasi-optimal calibration, standard-error estimation after calibration weighting; ADJUST = POST, CALVARS, PSTWGT, CLASS, VAR. dawn.SAS7bdat
WTADJX Example 2
(also includes nonresponse adjustment and resulting standard-errors using RLOGIST and WTADJUST)
Adjusting for nonresponse when nonresponse may not be missing at random, standard-error estimation after nonresponse adjustment; ADJUST = NONRESPONSE, ADJUST = POST, VARNONADJ, NUMER, DENOM, MAXITER, BESTIM, VDIFFVAR. dawn.SAS7bdat  

IMPUTE Examples

Performs the weighted sequential hot deck and, new in Release 11, cell mean, and regression-based (linear and logistic) methods of imputation for item nonresponse.
Examples Illustrates Datasets Used
IMPUTE Example 1 WSHD, CELLMN, LINEAR, and LOGISTIC Imputations. IMPBY, IMPVAR, CLASS, PRINT and OUTPUT WIC.SAS7bdat
IMPUTE Example 2 WSHD Multiple Imputations, NOTSORTED option, IMPBY, IMPVAR (MULTIMP option), IMPNAME, PRINT and OUTPUT WICWAGE.SAS7bdat

CROSSTAB Examples

Computes frequencies, percentage distributions, odds ratios, relative risks, and their standard errors (or confidence intervals) for user-specified cross-tabulations, as well as chi-square tests of independence and a series of Cochran-Mantel-Haenszel chi-square tests associated with stratified two-way tables.
Examples Illustrates Datasets Used
Crosstab Example 1 SETENV optional statement, CHISQ, LLCHISQ, PRINT, RFORMAT, SEWGT option NHANES3S3.SAS7bdat
Crosstab Example 2 SETENV optional statement, CMH test (Cochran-Mantel-Haenszel), PRINT, RFORMAT, SEWGT NHANES3S3.SAS7bdat
Crosstab Example 3 Breslow-Day Test Odds Ratio or Relative Risk, Breslow-Day Test of Homogeneity of "Odds Ratios", Prevalence Ratio, Risk Statement NHANES3S3.SAS7bdat
Crosstab Example 4 TEST, PRINT STEST option, SUBPOPX, SETENV, RFORMAT NHANES3S3.SAS7bdat
Crosstab Example 5 Accounting for multiple imputation of variables, Taylor series linearization method, BRR method with Fay's adjustment, SUBPOPX, SETENV NHANES3S3.SAS7bdat
Crosstab Example 6 Small Percentage Confidence Interval (SPCI), ROWPER, POWSPCI, STYLE option, RFORMATE, SUBPOPX NHANES3S3.SAS7bdat
Crosstab Example 7 Goodness-of-fit (GOF) Test, GOF Test using GOFIT statement, Wald-F (WALDF) Test, Satterthwaite-adjusted Chi-square (SATADJCHI) Test, SUBPOPX statement NHANES3S3.SAS7bdat
Crosstab Example 8 Stratum-specific Chi-square (CHISQ) Test, Stratum-adjusted Cochran-Mantel-Haenszel (CMH) Test, ANOVA-type (ACMH) Test, ALL Test option, DISPLAY option NHANES3S3.SAS7bdat
Crosstab Example 9 Kappa measure of agreement, AGREEE statement, TABLE statement, MERGHI option, WSUM option NHANES3S3.SAS7bdat

RATIO Examples

Computes estimates, standard errors, and confidence limits of generalized ratios of the form Σi wix / Σi wiyi.    Computes standardized estimates and tests single-degree-of-freedom contrasts among levels of a categorical variable.
Examples Illustrates Datasets Used
RATIO Example 1 NEWVAR, DENOM, NUMBER, SETENV, WEIGHT NHANES3S3.SAS7bdat
RATIO Example 2 POLY statement replaces, TABLES statement, Test of trends, NEST, WEIGHT, NEWVAR NHANES3S3.SAS7bdat
RATIO Example 3 DENOM, DENCAT, NUMBER, NUMCAT, SUBPOPX SADLTST3.SSD
RATIO Example 4 Compares PROC CROSSTAB versus PROC RATIO, SUBPOPX, LEVELS, SUBGROUP, SETENV SADLTST3.SSD
RATIO Example 5 REPWGT, WEIGHT, ADJFAY option, NUMBER, DENOM DESCRPTT.XPT

DESCRIPT Examples

Computes estimates of means, totals, proportions, percentages, geometric means, quantiles, and their standard errors and confidence limits; also computes standardized estimates and tests of single degree-of-freedom contrasts among levels of a categorical variable.
Examples Illustrates Datasets Used
DESCRIPT Example 1 SUBPOPN, NEST, RFORMAT, LEVELS, WEIGHT NHANES3S3.SAS7bdat
DESCRIPT Example 2 PERCENTILE, VAR, WEIGHT, SUBPOPN, RFORMAT NHANES3S3.SAS7bdat
DESCRIPT Example 3 SUBPOPN, SETENV, Design effect (DEFT2) option, STYLE option, NEST NHANES3S3.SAS7bdat
DESCRIPT Example 4 CONTRAST, PAIRWISE, DIFFVAR, SUBPOPN, SETENV NHANES3S3.SAS7bdat
DESCRIPT Example 5 CATLEVEL, VAR, DEFT1 option, RLABEL, RFORMAT NHANES3S3.SAS7bdat
DESCRIPT Example 6 VAR, CATLEVEL, NOMARG option, SETENV, RFORMAT NHANES3S3.SAS7bdat
DESCRIPT Example 7 VAR, CATLEVEL, CONTRAST, SETENV, RFORMAT NHANES3S3.SAS7bdat
DESCRIPT Example 8 TOTPER option, NSUM option, WEIGHT, LEVELS, SUBGROUP NHANES3S3.SAS7bdat
DESCRIPT Example 9 MI_COUNT option, SETENV, RFORMAT, NEST, WEIGHT

VARGEN Examples

New in Release 11. Computes point estimates, design-based variances, and contrast estimates for any user-defined parameter that can be expressed as a function of means, totals, proportions, ratios, population variances, population standard deviations, and correlations.
Examples Illustrates Datasets Used
VARGEN Example 1 XPER, PARAMETER, SUBPOPX, CLASS, DIFFVAR DA32722P1.SAS7bdat
VARGEN Example 2 XMEAN, XRATIO, XSUM, PARAMETER, SUBPOPX DA32722P1.SAS7bdat
VARGEN Example 3 XMEAN, XRATIO, XSUM, PARAMETER, SUBPOPX DA32722P1.SAS7bdat
VARGEN Example 4 XRATIO, XMEAN, PARAMETER, SUBPOPX, NOTSORTED DA32722P1.SAS7bdat

SURVIVAL Examples

Fits discrete and continuous proportional hazards models to failure time data; also estimates hazard ratios and their confidence intervals for each model parameter. Estimates exponentiated contrasts among model parameters (with confidence intervals). Includes facilities for time-dependent covariates, the counting process style of input, stratified baseline hazards, and Schoenfeld and Martingale residuals. Estimates conditional and predicted marginals and tests hypotheses about the marginals.
Examples Illustrates Datasets Used
SURVIVAL Example 1 Accounting for intracluster correlation in survival analysis, EVENT, CLASS, EFFECTS, REFLEVEL IRONSUD.SSD
SURVIVAL Example 2 Cox proportional hazards model TIES option, WALDCHI (WALD chi-square test) option, SATADJCHI (Satterthwaite-adjusted chi-square test) option, EFFECTS EXERCISE.SAS7bdat

KAPMEIER Examples

Fits the Kaplan-Meier model, also known as the product limit estimator, to survival data from sample surveys and other clustered data applications. KAPMEIER uses either discrete or continuous time variable to provide point estimates for the survival curve for failure time outcomes that may contain censored observations.
Examples Illustrates Datasets Used
KAPMEIER Example 1 Kaplan-Meier survival probability curve, STRHAZ, DESIGN, EVENT, TIME EXERCISE.SAS7bdat

REGRESS Examples

Fits linear regression models and performs hypothesis tests concerning the model parameters. Uses Generalized Estimating Equations (GEE) to efficiently estimate regression parameters with robust and model-based variance estimation. Estimates conditional and predicted marginals and tests hypotheses about the marginals.
Examples Illustrates Datasets Used
REGRESS Example 1 TEST, SUBPOPX, REFLEVEL, COND_EFF, LSMEANS NHANES_C_3.SAS7bdat
REGRESS Example 2 GEE linear regression, Delete-1 Jackknife variance estimation, Binder robust variance estimator, TEST, CONDMARG BORIC.SSD

LOGISTIC Examples

Fits logistic regression models to binary data and computes hypothesis tests for model parameters; also estimates odds ratios and their confidence intervals for each model parameter; estimates exponentiated contrasts among model parameters (with confidence intervals); uses GEE to efficiently estimate regression parameters, with robust and model-based variance estimation. Estimates conditional and predicted marginals, ratios of marginals, and tests hypotheses about the marginals.
Examples Illustrates Datasets Used
Logistic Example 1 EFFECTS, RFORMAT, RLABEL, REFLEVEL, EXP option on MODEL statement, Hosmer-Lemeshow Test BRFWGT.SAS7bdat
Logistic Example 2 Zeger and Liang's SE method, Naive SE method, Conditional marginals, REFLEVEL, SETENV BRFWGT.SAS7bdat
Logistic Example 3 PREDMARG (predicted marginal proportion), CONDMARG (conditional marginal proportion), PRED_EFF pairwise comparison, COND_EFF pairwise comparison, SUBPOPX SAMADULTED.SAS7bdat
Logistic Example 4 SEs by replicate method, REPWGT, EFFECTS, EXP option, REFLEVEL
Logistic Example 5 Modeling 2 interation terms, Test for "chunk interations", EFFECTS, SUBPOPX, REFLEVEL SAMADULTED.SAS7bdat
Logistic Example 6 PRED_EFF, PREDMARG, EFFECTS, SUBPOPX, REFLEVEL SAMADULTED.SAS7bdat
Logistic Example 7 EFFECTS, UNITS option, EXP option, SUBPOPX, REFLEVEL SAMADULTED.SAS7bdat
Logistic Example 8 Calculates R-indicator and propensity statistics, PREDSTAT, PSTD, PVAR, PMEAN, PRSTD ELS.SAS7bdat
Logistic Example 9 Calculation of response rates and standard errors, PREDSTAT, RESPRATE, SETENV, NEST ELS.SAS7bdat

MULTILOG Examples

Fits logistic and multinomial logistic regression models to ordinal and nominal categorical data and computes hypothesis tests for model parameters; estimates odds ratios and their confidence intervals for each model parameter; estimates exponentiated contrasts among model parameters (with confidence intervals), uses GEE to efficiently estimate regression parameters, with robust and model-based variance estimation. Estimates conditional and predicted marginals, ratios of marginals, and tests hypotheses about the marginals.
Examples Illustrates Datasets Used
MULTILOG Example 1 Logistic regression modeling, R and SEMETHOD options, CONDMARG, ADJRR option, CATLEVEL DARE.SSD
MULTILOG Example 2 GEE model-fitting with multinomial outcomes, Correlations, R options, Standard error, SEMETHOD option, CUMLOGIT option, CONDMARG CROSS.SSD
MULTILOG Example 3 REFLEVEL, CUMLOGIT option, SETENV, LEVELS, WEIGHT IRONSUD.SSD
MULTILOG Example 4 EFFECTS, CUMLOGIT option, SUBGROUP, LEVELS, SETENV IRONSUD.SSD
MULTILOG Example 5 PREDMARG, ADJRR option, GENLOGIT option, PRED_EFF, SUBPOPX

LOGLINK Examples

Fits log-linear regression models to count data not in the form of proportions. Typical examples involve counts of events in a Poisson-like process where the upper limit to the number is infinite. Estimates incidence density ratios and confidence intervals for each model parameter. Estimates exponentiated contrasts among model parameters (with confidence intervals). Uses GEE to efficiently estimate regression parameters, with robust and model-based variance estimation. Estimates conditional and predicted marginals and tests hypotheses about the marginals.
Examples Illustrates Datasets Used
LOGLINK Example 1 Log-linear regression modeling, MODEL, TEST, SUBPOPN, EFFECTS EPIL.SAS7bdat
LOGLINK Example 2 Log-linear regression modeling, SEMETHOD, REFLEVEL, EFFECTS, PREDMARG PERSONSX.SAS7bdat

RECORDS Examples

Prints observations from the input data set, obtains the contents of the input data set, and converts an input data set from one type to another. You can use the SUBPOPN or SUBPOPX statement to create a subset of a given data set, and you can use the SORTBY statement to sort your data. RECORDS is a non-analytic procedure.
Examples Illustrates Datasets Used
RECORDS Example 1 DATA option, FILETYPE option, COUNTREC option, CONTENTS optin, NOPRINT option EXERCISE.SAS7bdat
RECORDS Example 2 SORTBY, OUTPUT, REPLACE option, PRINT HANES3S3.SAS7bdat