BookmarkSubscribeRSS Feed
Calcite | Level 5

I'm getting duplicate records in my output dataset when I use the predicted= and residual= keywords (in the output statement)? Anybody else encounter this? (just wondering if I'm missing anything)


proc surveyreg data=name NOMCAR;
strata ;
cluster ;
weight ;
domain ;
class ;
model var = vars / VADJUST=NONE solution deff;
format ;
output out=name predicted=Predicted residual=Residual;

Opal | Level 21

Please provide a log that would show the absence of duplicates before and their presence after.

Calcite | Level 5

Unfortunately the SAS log does not include the number of obs read from the input file, which has 19,759 cases (exactly half of what is in the output file).


NOTE: Writing HTML Body file: sashtml.htm

NOTE: All observations were omitted due to missing values or non-positive weights in domain

Subset=non-DSST sample.

NOTE: The data set MISSING.RESID2_1999_2002 has 39518 observations and 186 variables.

NOTE: PROCEDURE SURVEYREG used (Total process time):

real time 11.45 seconds

cpu time 1.93 seconds


Calcite | Level 5

Hi, I noticed the same issue, and I would love to know what's going on.  When I use an out= statement with a domain statement in surveyreg, the output dataset has a full set of output rows for EACH level of the domain variable.  So three levels of the domain statement will write out a dataset with three times the observations as the original dataset.  The DOMAIN variable tells you what level each observation was generated for, but they don't seem to correspond to the original domain variable.  In other words, no matter what the original observation's value of the domain variable, you'll still get three output records for that observation.  Can anybody explain what SAS is doing?



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg



Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 3 in conversation