BookmarkSubscribeRSS Feed
MichaelMcG
Calcite | Level 5

I am a public health graduate student working with the NHANES data set. I'm trying to use SURVEYLOGISTIC to create a risk ratio plot with confidence limits. The professor provided the following code snippet:

 

ods graphics on;  
proc logistic data= NH1720_A;
class stroke (ref=first)
      SMKGP (REF=FIRST)
      racegp4 (ref=first)
      EDUGP4 (REF=LAST) / param=ref;
model STROKE = Age
               sex
               racegp4
               EDUGP4
               SMKGP / risklimits;
run;
ods graphics off;

It outputs the plot as expected.

 

When I run the following code: 

ODS GRAPHICS ON;
PROC SURVEYLOGISTIC data = analysis.DSdec NOMCAR;
STRATA SDMVSTRA;
CLUSTER SDMVPSU;
WEIGHT WTINT10YR;
CLASS RIAGENDR (REF = LAST)
DMDYRSUS (REF = FIRST)
DMDEDUC2 (REF = FIRST)
ACD040 (REF = FIRST)
FSDHH (REF = FIRST) / PARAM = REF;
MODEL FSDHH (EVENT = "High") = RIAGENDR
RIDAGEYR
DMDYRSUS
DMDEDUC2
INDFMPIR
ACD040 / CLODDS
RISKLIMITS;
LABEL RIAGENDR = "Gender"
RIDAGEYR = "Age"
DMDYRSUS = "Years of Residency in US"
DMDEDUC2 = "Highest Educational Level Attained"
INDFMPIR = "Ratio of Income to Federal Poverty Level"
FSDHH = "Household Food Security";
FORMAT RIAGENDR genderCatF.
DMDYRSUS USResLenCatF.
DMDEDUC2 eduCatF.
ACD040 homeLangCatF.
FSDHH HHFoodSecCatF.;
RUN;
ODS GRAPHICS OFF;

I get the following errors:

ERROR 22-322: Syntax error, expecting one of the following: ;, ABSFCONV, ALPHA, CHISQ, CLODDS, CLPARM, CODING, CORRB, COVB, DF, 
               EXPB, FCONV, GCONV, GRADIENT, ITPRINT, L, LINK, MAXITER, NOCHECK, NODUMMYPRINT, NOINT, OFFSET, PARMLABEL, RIDGING, 
               RSQUARE, SINGULAR, STB, TECH, TECHNIQUE, VADJUST, XCONV.  
ERROR 202-322: The option or parameter is not recognized and will be ignored.

Also, the syntax colorer in SAS Studio 3.81 colors the RISKLIMITS options in the professor's code, but not in mine, and removing the NOMCAR option in my code does not resolve the error. 

2 REPLIES 2
SAS_Rob
SAS Employee

The syntax for the two procedures, while similar is not identical.  If you want Wald confidence intervals for the odds ratios in SURVEYLOGISTIC then you should use the CLODDS option on the MODEL statement.

MichaelMcG
Calcite | Level 5
I appreciate the clarification. The assignment this is to produce a figure for our primary model. The material hasn’t really covered the differences between the different confidence interval estimates. I’m primarily interested in creating a figure of some sort, but I am having trouble finding the graphics options for SURVEYLOGISTIC.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 327 views
  • 1 like
  • 2 in conversation