### Step 1: Capture variables from Proc Logistic

PROC Logistic data= <dataset> ;

Class
<Var-1>  <var-2>  <categorical_var-n>; ** can go here with “/“ e.g. param=glm ;

Model
<Outcome_Var> = <Main-predictor> <Factor-1> <Factor-n> <Non-linear_Covariate> | <Non-linear_Covariate> ;

Oddsratio <Non-linear_Covariate> / at (MSPSS_scale= 20 30 40 50 60 70 80 90 ); ;

ODS Output OddsRatios = OR_Dataset ;
ODS Output OddsRatiosWald = OR_Wald_Dataset ;

RUN;

### Step 2: Generate variables for p-values for linear factors

DATA orwp_linear;

Set OR_Dataset;

alpha=.05 ;
stderr=abs(log(uppercl)-log(lowercl)) / (2*probit(1-alpha/2)) ;
wald=(log(oddsratioest)/stderr)**2 ;
p=1-probchi(wald,

Drop alpha ;

RUN;

### Step 3: Generate variables for p-values for non-linear factors

DATA orwp_nonlinear;

Set OR_Wald_Dataset;

alpha=.05 ;
stderr=abs(log(uppercl)-log(lowercl)) / (2*probit(1-alpha/2)) ;
wald=(log(oddsratioest)/stderr)**2 ;
p=1-probchi(wald,

Drop alpha ;

RUN;

### Step 4: Print table of linear and non-linear factors

PROC Print data= orwp_linear label noobs;

Format p pvalue6. ;
Label stderr=”Standard Error” wald=”Wald Chi-Square” p=”Pr > ChiSq”;

RUN;

PROC Print data= orwp_nonlinear label noobs;

Format p pvalue6. ;
Label stderr=”Standard Error” wald=”Wald Chi-Square” p=”Pr > ChiSq”;

RUN;