In the previous post https://statcompute.wordpress.com/2017/09/17/model-non-negative-numeric-outcomes-with-zeros/, I gave a brief introduction about the ZAGA (Zero-Adjusted Gamma) model that provides us a very flexible approach to model non-negative numeric responses. Today, I will show how to implement the ZAGA model with SAS, which can be conducted either jointly or by two steps.
In SAS, the FMM procedure provides a very convenient interface to estimate the ZAGA model in 1 simple step. As shown, there are two model statements, e.g. the first one to estimate a Gamma sub-model with positive outcomes and the second used to separate the point-mass at zero from the positive. The subsequent probmodel statement then is employed to estimate the probability of a record being positive.
data ds; set "/folders/myfolders/autoclaim" (keep = clm_amt bluebook npolicy clm_freq5 mvr_pts income); where income ~= .; clm_flg = (clm_amt > 0); run; proc fmm data = ds tech = trureg; model clm_amt = bluebook npolicy / dist = gamma; model clm_amt = / dist = constant; probmodel clm_freq5 mvr_pts income; run;
An alternative way to develop a ZAGA model in two steps is to estimate a logistic regression first separating the point-mass at zero from the positive and then to estimate a Gamma regression with positive outcomes only, as illustrated below. The two-step approach is more intuitive to understand and, more importantly, is easier to implement without convergence issues as in FMM or NLMIXED procedure.
proc logistic data = ds desc; model clm_flg = clm_freq5 mvr_pts income; run; proc genmod data = ds; where clm_flg = 1; model clm_amt = bluebook npolicy / link = log dist = gamma; run;