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;
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;
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;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.