Hi,
I am trying to visualise a significant categorical interaction in proc logistics via the below code.
Health is categorized as 0 - low, 1- med, 2 -high, bsex is 0- female, 1-male.
ODS graphics on;
PROC logistic data=work;
class Primiparity (ref="yes") Health (ref="2) bsex (ref="0")/param=ref;
MODEL LGAc (event='1') = Health Primiparity bsex Health_sex/noor;
effectplot / at(bSex=all) noobs;
effectplot slicefit(sliceby=bSex plotby=Health)/ noobs;
RUN;
Would this code be right?
Many thanks
You code does not include an interaction in the MODEL statement, so I don't think it is right.
If health and sex are categorical variables, then Health*Sex is meaningless code, you can't multiply health times sex.
Furthermore, even if you create the variable health_sex somehow, unless you do it properly you do not get the interaction. So let's clear this up first before we get into splitting the data sets.
MODEL LGAc (event='1') = Health Primiparity bsex Health*sex/noor;
In a model statement, constructs with an * do not indicate multiplication, it indicates creating an interaction (properly).
Show me the log from when you try this. I want to see the code as seen in the log, plus ERRORs, WARNINGs and NOTEs for this PROC step. Do not chop anything out of the log for this PROC step.
Please format the log so that it is readable. You do this by copying the log as text, then pasting it into the window that appears after you click on the </> icon. DO NOT SKIP THIS STEP.
@catch18 wrote:
Thanks @PaigeMiller!
It appears to have run without a problem. I'm not sure why I thought I had to create the variable first.
So, are we done?
Hi ... I gave specific instructions on how to provide the LOG from a SAS program. Please follow those instructions.
NOTE: PROC LOGISTIC is modeling the probability that LGAc='1'. NOTE: Convergence criterion (GCONV=1E-8) satisfied. NOTE: Under full-rank parameterizations, Type 3 effect tests are replaced by joint tests. The joint test for an effect is a test that all the parameters associated with that effect are zero. Such joint tests might not be equivalent to Type 3 effect tests under GLM parameterization. ERROR: The specified plot type does not support the variable configuration. NOTE: The SAS System stopped processing this step because of errors. NOTE: There were 283 observations read from the data set TARGET.PATTERN_MORPH_LOG. NOTE: PROCEDURE LOGISTIC used (Total process time): real time 1.07 seconds cpu time 0.73 seconds
1409 ODS graphics on; 1410 PROC logistic data= work;*Final model; 1411 class Primiparity(ref="Yes") Health (ref="2") bsex (ref="0")/param=ref; 1412 MODEL LGAc (event='1') = Health Primiparity bsex Health*bsex/noor; 1413 effectplot / at(bSex=all) noobs; 1414 effectplot slicefit(sliceby=bSex plotby=Health)/ noobs; 1415 RUN; NOTE: PROC LOGISTIC is modeling the probability that LGAc='1'. NOTE: Convergence criterion (GCONV=1E-8) satisfied. NOTE: Under full-rank parameterizations, Type 3 effect tests are replaced by joint tests. The joint test for an effect is a test that all the parameters associated with that effect are zero. Such joint tests might not be equivalent to Type 3 effect tests under GLM parameterization. ERROR: The specified plot type does not support the variable configuration. NOTE: The SAS System stopped processing this step because of errors. NOTE: There were 283 observations read from the data set TARGET.PATTERN_MORPH_LOG. NOTE: PROCEDURE LOGISTIC used (Total process time): real time 1.07 seconds cpu time 0.73 seconds
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.