Calculating Odds Ratios from Logistic Regression Results

One can obtain odds ratios from the results of logistic regression model.  Odds ratios derived are adjusted for predictors included in the model and explains the relationship between two groups (e.g., treatment and control group) and outcome (binary outcome).  I wrote the following Excel document that calculates odds ratio based on logit coefficients from the intercept and the predictor of interest (binary ones: e.g., impact coefficient, gender effect, etc.).

https://drive.google.com/file/d/0B7AoA5fyqX_sN0RUc0E5aFowb00/view?usp=sharing

Appendix (p.27) of the following document includes description of odds ratio.

http://www.doe.k12.de.us/cms/lib09/DE01922744/Centricity/Domain/91/MA1275TAFINAL508.pdf

STDCOEF to request standardized coefficients from PROC GLIMMIX

proc glimmix data=qc2 METHOD=RSPL;
class group_ID;
model Y = X
/dist=binomial link=logit s ddfm=kr STDCOEF;
run;

It is not clear how coefficients are standardized.  Based on my investigation, centering is definitely done around the variable's grand mean; however, SD used for standardization is not 1.  When I simulated it, SD was around 0.036 (meaning I created a z-score using mean=0 and STD=0.036 to get the same coefficient off STDCOEF,

Stat test on between-group variance

proc glimmix data=temp2 /*Method=RSPL*/ ;
class  CAMPUS;
model Y=/dist=binomial link=logit s ddfm=kr;
random int / subject = CAMPUS_14;
  covtest /wald;
output out=gmxout_alglog residual=resid;
RUN;

PROC GLIMMIX non-convergence problem solutions

Tips and Strategies for Mixed Modeling with SAS/STAT® Procedures Kathleen Kiernan, Jill Tao, and Phil Gibbs, SAS Institute Inc., Cary, NC, USA

ABSTRACT Inherently, mixed modeling with SAS/STAT® procedures, such as GLIMMIX, MIXED, and NLMIXED is computationally intensive. Therefore, considerable memory and CPU time can be required. The default algorithms in these procedures might fail to converge for some data sets and models. This paper provides recommendations for circumventing memory problems and reducing execution times for your mixed modeling analyses. This paper also shows how the new HPMIXED procedure can be beneficial for certain situations, as with large sparse mixed models. Lastly, the discussion focuses on the best way to interpret and address common notes, warnings, and error messages that can occur with the estimation of mixed models in SAS software.

http://support.sas.com/resources/papers/proceedings12/332-2012.pdf

glimmix data=xxx METHOD=RSPL  ITDETAILS;
class  xxx;
model xxx=  xxx
/dist=binomial link=logit s ddfm=kr;
random int / subject = xxx;
NLOPTIONS MAXITER=100;
run;

Tables available from PROC GLIMMIX

Output Added:
-------------
Name: ModelInfo
Label: Model Information
Template: Stat.Glimmix.ModelInfo
Path: Glimmix.ModelInfo
-------------

Output Added:
-------------
Name: ClassLevels
Label: Class Level Information
Template: Stat.Glimmix.ClassLevels
Path: Glimmix.ClassLevels
-------------

Output Added:
-------------
Name: NObs
Label: Number of Observations
Template: Stat.Glimmix.NObs
Path: Glimmix.NObs
-------------

Output Added:
-------------
Name: Dimensions
Label: Dimensions
Template: Stat.Glimmix.Dimensions
Path: Glimmix.Dimensions
-------------

Output Added:
-------------
Name: OptInfo
Label: Optimization Information
Template: Stat.Glimmix.OptInfo
Path: Glimmix.OptInfo
-------------

Output Added:
-------------
Name: IterHistory
Label: Iteration History
Template: Stat.Glimmix.IterHistory
Path: Glimmix.IterHistory
-------------
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: At least one element of the gradient is greater than 1e-3.

Output Added:
-------------
Name: ConvergenceStatus
Label: Convergence Status
Template: Stat.Glimmix.ConvergenceStatus
Path: Glimmix.ConvergenceStatus
-------------

Output Added:
-------------
Name: FitStatistics
Label: Fit Statistics
Template: Stat.Glimmix.FitStatistics
Path: Glimmix.FitStatistics
-------------

Output Added:
-------------
Name: CovParms
Label: Covariance Parameter Estimates
Template: Stat.Glimmix.CovParms
Path: Glimmix.CovParms
-------------

Output Added:
-------------
Name: ParameterEstimates
Label: Solutions for Fixed Effects
Template: Stat.Glimmix.ParameterEstimates
Path: Glimmix.ParameterEstimates
-------------

Output Added:
-------------
Name: Tests3
Label: Type III Tests of Fixed Effects
Template: Stat.Glimmix.Tests3
Path: Glimmix.Tests3
-------------

SAS PROC GLIMMIX method=

The default technique is METHOD=RSPL, corresponding to maximizing the residual log pseudo-likelihood with an expansion about the current solutions of the best linear unbiased predictors of the random effects. In models for normal data with identity link, METHOD=RSPL and METHOD=RMPL are equivalent to restricted maximum likelihood estimation, and METHOD=MSPL and METHOD=MMPL are equivalent to maximum likelihood estimation.

***

The following SAS Usage Note:

  http://support.sas.com/kb/37107 

  http://support.sas.com/kb/40724

 

provide information on testing covariance parameters when using PROC MIXED and PROC GLIMMIX.

 

Using PROC LOGISTIC to Estimate the Rasch Model by Pan and Chen

http://support.sas.com/resources/papers/proceedings11/342-2011.pdf

Can this be right?  If right, it helps reduce the computational demand off the procedure.   Page 4:

"When thousands of persons take a test, the procedure takes a long time to estimate the parameters. It is well known that the Rasch model gives the same parameter estimates for each person who receives the same total score. So, variable ‘person’ is able to be replaced with variable ‘total’ when all examinees answer all items as shown by Nord (2008). After the model is fit, the estimate of the parameter for each person is equal to the estimate of the parameter of the total score corresponding to the person’s total score. The third code example and its output are shown as follows:"

Logistic regression, comparing group means

proc glimmix data=asdf namelen=32;
where disaster_type /*age_desc*/ ne "";
class GROUPING_D_RISK_PT;

model &out
=
GROUPING_D_RISK_PT

/solution ddfm=kr dist=binomial link=logit s STDCOEF ;

lsmeans GROUPING_D_RISK_PT / ilink diff;

output out=gmxout residual=resid;
ods output
ParameterEstimates=kaz1
CovParms=uekawa1
nobs=jeana
ModelInfo=estes
dimensions=diminfo
ConvergenceStatus=concon
FitStatistics=FITSTAT
Diffs=DIF_RESULT
;
run;

Dummy variables in logistic regression models

Why do switching of values in a dummy variable and the use of class statement in PROC LOGISTIC change the coefficients in logistic regression?

(1) and (2) produce the same results. (3) and (4) produce the same results.

(1)
proc logistic data=here.asdf descending ;
model college= boy ;
run;

(2)
proc logistic data=here.asdf descending ;
class girl;
model college= girl ;
run;

(3)
proc logistic data=here.asdf descending ;
model college= girl;
run;

(4)
proc logistic data=here.asdf descending ;
class boy;
model college= boy ;
run;

(1) Estimates (2) Estimates (3) Estimates (4) Estimates
Intercept

0.5346

 Intercept

0.3645

 Intercept

0.1945

 Intercept

0.3645

boy      

-0.3401

 girl    

-0.1701

 girl

0.3401

 boy      

0.1701

               
Odds ratio

0.712

 

0.712

 

1.405

 

1.405