MetriScient          

Mixed Effects Regression Models

This method is also known as ‘Random Coefficients Model’.

Empirical Bayes Model, similar to the Pooled regression method, is applied when time-series data is scarce. The only difference is that this method uses Bayesian techniques to leverage information across different sub-groups (stores, products etc.) to generate ‘sub-group level’ estimates of coefficients in addition to ‘overall’ coefficients.

Here's an illustration to demonstrate the power of this approach:

You are trying to evaluate the performance of a program that you ran in 5 test markets for 10 weeks. You would like to know the effectiveness of the program in each of the 5 markets. 10 Weeks doesn't give you a robust enough sample size to run a standard regression model, but with Mixed Effects Modeling you can actually leverage information over the 10 weeks across the 5 markets and actually generate coefficients measuring the impact within each of the 5 markets individually and across the 5 markets in total in a single model.

SAS Code:

Below code is for a Random Coefficients Model. Adding  a "PRIOR" statement in the below code will yield a Bayesian (Empirical Bayes') analysis.

/*-------------------------------------------------------------------------------------------------------------------*/

PROC MIXED DATA=IN_DSN /*THIS IS THE NAME OF THE INPUT DATASET*/ SCORING=5;
CLASS RANDOM_GROUP /*CATEGORY OR CLASS FOR WHICH COEFFICIENTS NEED TO BE RANDOMIZED OR SEPARATELY ESTIMATED FOR*/
MODEL DEP_VAR /*THIS IS THE NAME OF THE DEPENDENT VARIABLE IN THE ABOVE DATASET*/
= IND_VAR1-IND_VARN /*THIS IS THE LIST OF INDEPENDENT VARIABLES FROM THE ABOVE DATASET*/
/S;
RANDOM INTERCEPT /*INCLUDE INTERCEPT IN RANDOM EFFECTS IF DATA IS NOT STANARDIZED BY RANDOM GROUP*/
IND_VAR1-IND_VARN /*INCLUDE ALL INDEPENDENT EFFECTS TO BE SEPARATELY ESTIMATED FOR EACH OF THE RANDOM GROUP IN THE CLASS VARIABLE ABOVE*/
/S SUB=RANDOM_GROUP /*CATEGORY OR CLASS FOR WHICH COEFFICIENTS NEED TO BE RANDOMIZED OR SEPARATELY ESTIMATED FOR*/;
ODS OUTPUT SOLUTIONF=F SOLUTIONR=R; /*FIXED EFFECTS IN SOLUTIONF DATASET NEED TO BE ADDED TO CORRESPONDING EFFECTS FOR EACH OF THE RANDOM GROUP
TO YIELD TOTAL RANDOM EFFECT FOR THAT GROUP*/;
RUN;

/*-------------------------------------------------------------------------------------------------------------------*/

SAS also recently launched Proc Glimmix that conducts a Random Effects model for Binary variables (essentially this procedure does for Proc Logistic, what Proc Mixed did for Proc Reg). Syntax follows similar structure as Proc Mixed above.

 © Copyright 2009 eNumerys Global LLC. All Rights Reserved.