BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ljlynn97
Fluorite | Level 6

I'm trying to produce a slicefit type plot and want to specify values for the sliceby variable.

 

Outcome is a binary outcome (0/1). Variable1 and Variable2 are both continuous variables.

 

The code below produces exactly what I want except for one small issue: I'd like to set the values for sliceby=variable2 to be like 20, 40, 60, etc., not the 15.66, 36.36, 57.06, etc. that are being chosen automatically.

 

I have tried to use AT to specify values but can't get the result I want. The sliceby values are still the ones chosen automatically.

 

proc logistic data=my_dataset PLOTS(ONLY) = EFFECT(showobs);
	model outcome = variable1 variable2 variable1*variable2 / rsquare;
    effectplot slicefit (x=variable1 sliceby=variable2)
   	 / noobs
	;
run;

SliceFitPlot.png

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
sliceby=variable2=20 40 60 80 100

 

Something like that should work for you.

 

https://blogs.sas.com/content/iml/2016/06/22/sas-effectplot-statement.html

 


@ljlynn97 wrote:

I'm trying to produce a slicefit type plot and want to specify values for the sliceby variable.

 

Outcome is a binary outcome (0/1). Variable1 and Variable2 are both continuous variables.

 

The code below produces exactly what I want except for one small issue: I'd like to set the values for sliceby=variable2 to be like 20, 40, 60, etc., not the 15.66, 36.36, 57.06, etc. that are being chosen automatically.

 

I have tried to use AT to specify values but can't get the result I want. The sliceby values are still the ones chosen automatically.

 

proc logistic data=my_dataset PLOTS(ONLY) = EFFECT(showobs);
	model outcome = variable1 variable2 variable1*variable2 / rsquare;
    effectplot slicefit (x=variable1 sliceby=variable2)
   	 / noobs
	;
run;

SliceFitPlot.png


 

View solution in original post

2 REPLIES 2
Reeza
Super User
sliceby=variable2=20 40 60 80 100

 

Something like that should work for you.

 

https://blogs.sas.com/content/iml/2016/06/22/sas-effectplot-statement.html

 


@ljlynn97 wrote:

I'm trying to produce a slicefit type plot and want to specify values for the sliceby variable.

 

Outcome is a binary outcome (0/1). Variable1 and Variable2 are both continuous variables.

 

The code below produces exactly what I want except for one small issue: I'd like to set the values for sliceby=variable2 to be like 20, 40, 60, etc., not the 15.66, 36.36, 57.06, etc. that are being chosen automatically.

 

I have tried to use AT to specify values but can't get the result I want. The sliceby values are still the ones chosen automatically.

 

proc logistic data=my_dataset PLOTS(ONLY) = EFFECT(showobs);
	model outcome = variable1 variable2 variable1*variable2 / rsquare;
    effectplot slicefit (x=variable1 sliceby=variable2)
   	 / noobs
	;
run;

SliceFitPlot.png


 

ljlynn97
Fluorite | Level 6
Yes, thank you! I knew it had to be something simple. And thanks for the link, I'll add it to my collection.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 742 views
  • 2 likes
  • 2 in conversation