Hello,
I have been running Proc Surveyfreq using SAS 9.2. The code runs OK. However, now that I have SAS 9.4, running the same code generates errors. Here is the log:
247 proc surveyreg data = data1 ;
248 strata _ststr; *stratification variable;
249 cluster _psu; *first stage clustering variable;
250 weight _PWTAS;
251 class ageg;
252 model VART1 = ageg /noint solution clparm;
253 estimate 'rat56' ageg 0.128810 0.182648 0.219077 0.299194 0.170271;
254 ods output 'estimates' = ratt56(rename=(estimate=adj_pect lowrcl=adj_lcl uprcl=adj_ucl) keep=estimate lowrcl
254! uprcl);
255 run;
NOTE: In data set data1, total 1119 observations read, 126 observations with missing values or non-positive weights are omitted.
NOTE: The structure of the Estimates table has changed from an earlier release of SAS.
WARNING: Output ''estimates'' was not created. Make sure that the output object name, label, or path is spelled correctly. Also, verify that the appropriate procedure options are used to produce the requested output object. For example, verify that the NOPRINT option is not used.
NOTE: PROCEDURE SURVEYREG used (Total process time):
real time 0.47 seconds
cpu time 0.26 seconds
Thank you for your help,
Art
The log contains
NOTE: The structure of the Estimates table has changed from an earlier release of SAS.
Now you need
ods output Estimates = ratt56(rename=(estimate=adj_pect lower=adj_lcl upper=adj_ucl) keep=estimate lower upper);
The note says the ESTIMATES results set may have change. I would try the code without any dataset options and see if the variable names have changed. Also, I don't think the procedure output table needs the quotes.
The log contains
NOTE: The structure of the Estimates table has changed from an earlier release of SAS.
Now you need
ods output Estimates = ratt56(rename=(estimate=adj_pect lower=adj_lcl upper=adj_ucl) keep=estimate lower upper);
Ballard & PGStats,
As you have suggested, output in the ODS statement does not need to be surrounded by single quotes. Without the single quotes the new log from
ods output Estimates = ratt56(rename=(estimate=adj_pect lower=adj_lcl upper=adj_ucl) keep=estimate lower upper);
says:
NOTE: The structure of the Estimates table has changed from an earlier release of SAS.
WARNING: The variable lower in the DROP, KEEP, or RENAME list has never been referenced.
WARNING: The variable upper in the DROP, KEEP, or RENAME list has never been referenced.
WARNING: The variable lower in the DROP, KEEP, or RENAME list has never been referenced.
WARNING: The variable upper in the DROP, KEEP, or RENAME list has never been referenced.
I will need those variables as heading of the columns of the tables to be generated later.
Is there any SAS literature on KEEP/DROP within ODS Output?
Thanks,
Have a great weekend,
ArtPsh
You must include option CL in your ESTIMATE statement to get the LOWER and UPPER variables in ODS table Estimates.
Hello PGStats,
It looks like you are pointing me to the right direction. I tried to include the CL options as follows:
ods output estimates = att156(rename=(estimate=adj_pct lowercl=adj_lcl uppercl=adj_ucl) keep=estimate lowercl
uppercl) / options = cl;
-
22
76
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string (in lieu of / before options=cl).
ERROR 76-322: Syntax error, statement will be ignored.
416 run;
How do you correct that syntax error?
Thank you,
ArtPsh
Please read the documentation for the ESTIMATE statement.
estimate 'rat56' ageg 0.128810 0.182648 0.219077 0.299194 0.170271 / cl;
Hi PGStats,
I spent my time yesterday reading some literature on Proc Surveyreg, Estimate statement and ODS Output statement. I was unable to solve the intriguing error messages. This morning, SAS Technical Support advised me to do the following:
"The table name for the parameter estimates is ParameterEstimates, so your ODS statement should be:
ods output parameterestimates." Inserting ParameterEstimates afte ODS Output helped solve the problem.
Thank you for your input,
ArtPsh
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.