BookmarkSubscribeRSS Feed
amin1234
Obsidian | Level 7
proc logistic data=stat1.safety plots(only)=(effect oddsratio);
	class region (ref="Asia") size (ref="1")/ param=ref;
	model unsafe (event="1") = Weight Size Region;
	store out=issafe;
run;

data checkSafety;
   length Region $9.;
   input Weight Size Region $ 5-13;
   datalines;
   4 1 N America
   3 1 Asia     
   5 3 Asia     
   5 2 N America
	 ;
run;

proc plm restore=issafe;
	score data=checksafety out=safechecked / ilink;
run;

proc print data=safechecked;
run;

Hello Everyone, above is my code. I have attached the data set as well. 

 

I am getting missing values for the predicted values in the safechecked data set in proc plm. 

 

any ideas why the predicted variables are missing? 

 

4 REPLIES 4
Reeza
Super User

Your checksafety data set is not being created correctly. You've specified 5-13 but then indented your data, so it actually starts at 9. So the region variable is truncated. I'm assuming you used the code clean up button or CTRL+I and it did it automatically? If so, I would consider this a bug in SAS tbh. I'm going to add it as a suggestion for improvement actually. 
EDIT: That's wrong, the auto code formatting doesn't do that. 

 

 


@amin1234 wrote:
proc logistic data=stat1.safety plots(only)=(effect oddsratio);
	class region (ref="Asia") size (ref="1")/ param=ref;
	model unsafe (event="1") = Weight Size Region;
	store out=issafe;
run;

data checkSafety;
   length Region $9.;
   input Weight Size Region $ 5-13;
   datalines;
   4 1 N America
   3 1 Asia     
   5 3 Asia     
   5 2 N America
	 ;
run;

proc plm restore=issafe;
	score data=checksafety out=safechecked / ilink;
run;

proc print data=safechecked;
run;

Hello Everyone, above is my code. I have attached the data set as well. 

 

I am getting missing values for the predicted values in the safechecked data set in proc plm. 

 

any ideas why the predicted variables are missing? 

 


 

 

amin1234
Obsidian | Level 7

@Reeza Thanks for your reply. I don't think it's the indentation. When the SELECTION= option is added to the model statement, the predicted values are not missing which is kind of strange. 

Reeza
Super User

Easy to check, check your input data set via proc print or opening it. That alone fixed it for me and as shown that data would read in correctly. 

 


@amin1234 wrote:

@Reeza Thanks for your reply. I don't think it's the indentation. When the SELECTION= option is added to the model statement, the predicted values are not missing which is kind of strange. 


 

 

StatDave
SAS Super FREQ

The easiest way to fix this is to tell the INPUT statement to read the REGION variable until two blanks or the end of line is found. This is what & does. So, change your INPUT statement to this:

 

   input Weight Size Region &;

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 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
  • 4 replies
  • 1837 views
  • 0 likes
  • 3 in conversation