Programming the statistical procedures from SAS

PROC SURVEYREG ODS table ERROR

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

PROC SURVEYREG ODS table ERROR

[ Edited ]

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    


Accepted Solutions
Solution
‎04-19-2016 04:58 PM
Respected Advisor
Posts: 4,606

Re: PROC SURVEYFREQ

[ Edited ]

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);

 

 

PG

View solution in original post


All Replies
Grand Advisor
Posts: 10,016

Re: PROC SURVEYFREQ

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.

Solution
‎04-19-2016 04:58 PM
Respected Advisor
Posts: 4,606

Re: PROC SURVEYFREQ

[ Edited ]

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);

 

 

PG
Occasional Contributor
Posts: 6

Re: PROC SURVEYFREQ

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

Respected Advisor
Posts: 4,606

Re: PROC SURVEYFREQ

[ Edited ]

You must include option CL in your ESTIMATE statement to get the LOWER and UPPER variables in ODS table Estimates.

PG
Occasional Contributor
Posts: 6

Re: PROC SURVEYFREQ

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

 

Respected Advisor
Posts: 4,606

Re: PROC SURVEYFREQ

Please read the documentation for the ESTIMATE statement.

 

estimate 'rat56' ageg 0.128810 0.182648 0.219077 0.299194 0.170271 / cl;

PG
Occasional Contributor
Posts: 6

Re: PROC SURVEYREG ODS table ERROR

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

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 351 views
  • 0 likes
  • 3 in conversation