BookmarkSubscribeRSS Feed
stellapersis7
Obsidian | Level 7

Hi all,

I am student and doing a project, so I am confused about a linearity assumption of a continuous independent variable which is included in the model.

My aim is to check the graphs between gestage and estimated probability for genders male and female.

I need to check when the variable is included as 1) categorical and 2) continuous, if the linearity assumption is met.

My code is 

proc genmod data = SAS.z_final descending;

class gender  under_weight  QNO;

model under_weight = gender gestage /dist=b link=logit type1 type3;

repeated subject = QNO/ corr=cs corrw;

output out = pain pred=p resraw=r;

run;

My question is how to get the linearity assumptions for the independent variable gestage as continuous and categorical variables for gender(independent categorical variable) male and female?

3 REPLIES 3
PaigeMiller
Diamond | Level 26

For continuous X in a logistic regression, this is suggested in the SAS FASTats:

 

Linearity in the logit (or link), testingTo test for nonlinearity in the logit (for logistic models) and more generally for finding a suitable functional form for an independent variable in a generalized linear model (GLM), use the spline smoother on the variable in SAS/STAT PROC GAMPL or SAS Viya PROC GAMMOD. See the example titled "Nonparametric Logistic Regression" in the GAMPL documentation. Also see the ASSESS statement in SAS/STAT PROC GENMOD for assessing the covariate or link function in a GLM or Generalized Estimating Equations (GEE) model.

Also https://www.lexjansen.com/sesug/2019/SESUG2019_Paper-233_Final_PDF.pdf

 

https://stats.stackexchange.com/questions/169348/how-should-i-check-the-assumption-of-linearity-to-t... points to using the Box-Tidwell test.

 

Checking linearity for categorical predictor makes no sense.

--
Paige Miller
Ksharp
Super User
Paige,
Sure. I forgot the "ASSESS statement in PROC GENMOD " .

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1132 views
  • 0 likes
  • 3 in conversation