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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 856 views
  • 2 likes
  • 2 in conversation