BookmarkSubscribeRSS Feed
docstu
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;
run;

3 REPLIES 3
PGStats
Opal | Level 21

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

PG
docstu
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

 

monkeybeth
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?

sas-innovate-2024.png

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.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1045 views
  • 0 likes
  • 3 in conversation