<<

How D-I-D you do that? Basic Difference-in-Differences Models in SAS® E Margaret Warton, Kaiser Permanente Division of Research, Oakland, CA Melissa M Parker, Kaiser Permanente Division of Research, Oakland, CA Andrew J Karter, Kaiser Permanente Division of Research, Oakland, CA

ABSTRACT Long a mainstay in econometrics research, difference-in-differences (D-I-D) models have only recently become commonly used in health services and epidemiologic research. D-I-D study designs are quasi-experimental, can be used with retrospective observational data, and do not require exposure randomization. This study design estimates the difference in pre-post changes in an outcome comparing an exposed group to an unexposed (reference) group. The outcome change in the unexposed group estimates the expected change in the exposed group had the group been, counterfactually, unexposed. By subtracting this change from the change in the exposed group (the “difference in differences”), the effects of background secular trends are removed. In the basic D-I-D model, each subject serves as his or her own control, removing confounding by known and unknown individual factors associated with the outcome of interest. Thus, the D-I-D generates a causal estimate of the change in an outcome associated with the initiation of the exposure of interest while controlling for biases due to secular trends and confounding. A basic repeated-measures generalized linear model provides estimates of population-average slopes between two points for the exposed and unexposed groups and tests whether the slopes differ by including an interaction term between the time and exposure variables. In this paper, we illustrate the concepts behind the basic D-I-D model and present SAS® code for running these models. We include a brief discussion of more advanced D-I-D methods and present an example of a real-world analysis using data from a study on the impact of introducing a value-based insurance design (VBID) medication plan Kaiser Permanente Northern California on change in medication adherence.

INTRODUCTION Difference-in-differences (D-I-D) methods have been used in the field of econometrics for several decades but have only recently become more widely used in the fields of epidemiology and health research. D-I-D analysis is a quasi- experimental design used in the study of longitudinal cohort data with pre- and post-exposure repeated measures. It allows the comparison of changes over time in an outcome between exposed and control groups while accounting for changes in secular trends and controlling for both measured and unmeasured confounding. Because the design forces adherence to time-ordering in exposure and outcome measures, estimates from D-I-D models can be interpreted causally. Simple D-I-D models can be used effectively when data are available from a longitudinal pre/post cohort design. Either prospective or retrospective data collection is possible, so long as the timing of measurements is known. In this paper, we explain the fundamental D-I-D study design and illustrate a basic analysis using SAS® , specifically the GLM and MIXED procedures that allow accounting for repeated measures.

THE D-I-D DESIGN OVERVIEW The D-I-D design is conceptually simple: measure the change in an outcome between the pre and post periods for an exposed group and a control group, then subtract one from the other to see the “difference in the differences” between the groups. In other words, the basic D-I-D study is a “pre-post” design that compares the changes between two groups over two time points.

EXPOSED VERSUS UNEXPOSED In order to use the D-I-D analytic approach, a longitudinal cohort is divided into at least two groups: subjects exposed and unexposed to the condition or treatment of interest. Outcome measures must be available for members of both groups before and after a time point at exposure occurs for the exposed group. While the time points do not have to be specified calendar dates or even the same for each subject, this timing is the simplest way to create the pre-post longitudinal study. For this reason, this study design is very useful for measuring the results of programs, policies or protocols that are implemented at a specific time and are applied to a subgroup within a population. As with any study design requiring an unexposed comparison group, the identification of an appropriate control group is key. The control group should be as similar as possible to the exposed group, observed over the same period of time, and hopefully differing only in the exposure.

PRE AND POST MEASURES In its simplest form, the only data required for a D-I-D analysis are the exposure flag, the outcome measures,

1 How D-I-D you do that? Basic Difference-in-Differences Models in SAS®, continued

identified as pre or post, and an identifier variable for each individual. In situations where the predicted outcomes should take account of the various population characteristics (age and sex, for example), these variables can be included in the model and then used to adjust predicted values. The simplest D-I-D models are used with continuous outcomes, as changes in continuous outcomes are more easily interpreted. D-I-D models can be used with binary outcomes, although the interpretation for binary outcomes is a little more complicated. This paper will focus on continuous outcomes.

CAUSAL INFERENCE The pre-post design maintains the time-ordering of events, an important aspect of the design that meets the basic requirement of any model that can be interpreted causally. In addition, in a D-I-D analysis, each subject serves as its own control: the characteristics of each subject that remain the same in both periods therefore cannot be confounders. This is true whether or not those characteristics are measured, so results from the D-I-D model account for both measured and unmeasured confounders. Including the unexposed control group in the model adjusts for underlying temporal trends in the outcome, thus differences between changes in the exposed group and the unexposed group represent changes specifically due to the exposure. For these reasons, the results from a D-I-D analysis can be interpreted causally, making it an ideal design for pre-post analyses in observational studies.

EXAMPLE STUDY BACKGROUND Healthcare costs have been rising rapidly in the United States for many years. In the past, nearly all health care plans provided by Kaiser Permanente of Northern California (KPNC) had no deductible and low co-pays. However, during the past decade, employers and individuals have begun to purchase health insurance with a deductible and higher co-pays to reduce premium costs. To counter increasing out-of-pocket costs, new benefit programs have been introduced to reduce costs for effective treatments that have been shown to improve patient health. The theory is that encouraging use of these preventive treatments will lower the cost of providing care over time. Plans like these that are built into the insurance policy are known as Value-Based Insurance Design (VBID) benefits. One important healthcare area experiencing rising costs is prescription medications. As costs increase for medications, patients may take lower doses than recommended or stop taking a medication altogether. These behaviors are often measured by medication adherence: the percentage of time over a given period during which a patient has adequate medication available, usually based on prescription refill data. In 2013, KPNC began offering a VBID pharmacy benefit option (VBID Rx) to provide certain prescription medications for free, including drugs to treat high cholesterol, diabetes, and hypertension. Using this potential natural experiment, we wanted to know if the VBID medication benefit improved adherence to medications for chronic conditions among patients with a deductible plan(Reed, Mary. 2016). However, we did not have a large enough sample of patients were on a deductible plan and had the VBID medication plan added later. Instead, we identified a cohort of patients on a non-deductible plan in 2013 whose employers switched to a deductible plan at the beginning of 2014. Our comparison cohort consisted of patients on a non-deductible plan in 2013 who switched to a deductible plan with no VBID benefit in 2014. We then compared medication adherence among those with and without the VBID benefit in 2013 and 2014. With the D-I-D design, we could identify changes in medication adherence due to the VBID plan while simultaneously removing the influence of the underlying change to a deductible plan and adjusting for confounding, measured or not, at the subject level. Figure 1 illustrates the study timing, cohort composition and sample sizes.

Figure 1. Cohort Description for Difference-in-Differences Study of VBID Medication Plan Implementation and Medication Adherence

2 How D-I-D you do that? Basic Difference-in-Differences Models in SAS®, continued

THE D-I-D STUDY DESIGN IN DETAIL

A graphical illustration can be helpful in understanding the D-I-D study design. In Figure 2, A1 and A2 indicate the mean medication adherence values of the outcome at the pre and post time periods, respectively, in the unexposed group. Similarly, B1 and B2 represent the change in pre and post adherence for the exposed group. The change in the unexposed group over time is represented by the difference in height between the pre and post mean outcomes, the dashed line. Since the measurement points are a year apart, the slope of this line represents the annual rate of change and is interpreted as the background secular trend in the outcome over time in a group not affected by the exposure. Similarly, the slope of the solid line indicates the change in the medication adherence between the pre and post periods among those who experienced the exposure. Subtracting the change in the unexposed (control) group from the change in the exposed group, or vice versa, provides an estimate of the effect of the exposure, adjusted for background trends.

Figure 2. Graphic Representation of the Difference-in-Differences Design

EQUATION FOR A BASIC DIFFERENCE-IN-DIFFERENCES MODEL In Figure 2, the slopes of the lines for the exposed and unexposed groups are allowed to vary, which implies that the underlying model will need to include an interaction term. The basic equation for the D-I-D model is

μit = β0 + βpost*Post + βexp*Exposure + βinteraction*Post*Exposure + εit where μij is the expected mean value for subject i at time t, Post is a binary indicator that the outcome measurement was made in the post period, Exposure is a binary indicator that the subject is in the exposure group during the post period, and εit is the error term for the outcome measure of subject i at time t . As usual, errors are assumed to be normally distributed with a mean of zero. Note that this model equation includes only the outcome, time, and exposure measures – it includes no other subject-level measures. Using this equation along with the figure, we can show that the coefficient on the interaction term alone provides the estimate and inference of the difference-in-

3 How D-I-D you do that? Basic Difference-in-Differences Models in SAS®, continued

differences.

From Figure 2, the Difference-in-Differences estimate (ignoring error terms) is

∆A - ∆B =

(β0 – [β0 + βpost ]) - ([β0 + βexp] – [β0 + βpost+ βexp + βinteraction ]) =

(β0 - β0 -βpost) - (β0 + βexp - β0 - βpost- βexp - βinteraction ) =

(-βpost) - (- βpost- βinteraction ) =

βinteraction

In Figure 3, the parameter β0 represents the intercept, the mean medication adherence in the non-VBID group at the

2013 measurement. Βpost is the change in medication adherence in the non-VBID group between 2013 and 2014. The coefficient βexp indicates the difference in adherence between the VBID and the non-VBID groups in 2013, while βinteraction measures the difference in slopes between the two groups: it is a direct measure of the difference-in- differences between the two groups. In the model results, if this coefficient estimate is statistically significant, it is likely the slopes in the two groups are not parallel, and so the exposure has affected the outcome in the exposed group differently than the underlying background trend, as captured by the unexposed group.

Figure 3. Graphic Representation of the Difference-in-Differences Design with Model Coefficients

4 How D-I-D you do that? Basic Difference-in-Differences Models in SAS®, continued

D-I-D MODELING METHODS Because the D-I-D model is a repeated measures design, outcome values for a given subject are assumed to be correlated, while the outcome values between subjects are assumed independent. To account for the correlation within subjects, any model used will need to deal with repeated measures as well as providing results for comparisons between the exposure groups.

Repeated Measures ANOVA (The GLM Procedure) One method for analyzing D-I-D studies is repeated measures ANOVA using PROC GLM in SAS. This method accounts for correlation within subjects and provides the mean outcome values in each exposure group at each time period. It also determines the statistical significance of the interaction term and can compare the differences in the mean outcome values among the time/exposure groups. However, being an ANOVA, it does not generate model coefficients or allow for the generation of individual predicted values; it simply tests whether the mean values between the groups are different. This means that the mean outcome values from the ANOVA are based on the characteristics of a specific cohort and are not easily generalizable to other populations with different characteristics.

Repeated Measures Linear Regression Model (The MIXED Procedure) A more flexible analytic approach is the repeated measures linear model using PROC MIXED(Wolfinger, Russ and Chang, Ming). As in repeated measures ANOVA, this method tests the significance of the interaction term while accounting for correlation between measures. Unlike the ANOVA model, however, this method provides estimates model parameters and can be used to create predicted outcome values. Like the ANOVA model, an interaction term between time and exposure in the model allows the slopes of the exposure groups to differ. The LSMEANS and ESTIMATE statements can be used to generate summary predicted values for different subgroups within the analytic cohort. In addition, the model coefficients can be used to predict mean outcome values in the full cohort under different counterfactual scenarios. For example, to estimate the mean adherence in the full cohort during the pre period assuming no exposure in the post period, keep only the POST=0 records, set EXPOSED=0 for all cohort members, and generate predicted values using the model coefficients. Repeating this for all time periods and exposures can provide more realistic estimates of the outcome than the methodology used by the LSMEANS statement.

Using Propensity Score In many situations, it is desirable to analyze a cohort composed of exposure groups with very similar characteristics, as would be the case in a cohort created for a randomized control trial. As in other causal observational methods, this similarity of distributions may be achieved by first modeling the probability of being in the exposed group using the available measured characteristics for the cohort. These probabilities, the “propensity” to be exposed, are then used to weight the cohort, hopefully resulting in similar distributions of potential confounders in the exposed and unexposed groups.

THE D-I-D STUDY DESIGN IN ACTION

DO VBID DRUG BENEFITS AFFECT MEDICATION ADHERENCE IN PATIENTS WITH CHRONIC CONDITIONS FACING INCREASED DEDUCTIBLE COSTS? As a first step in any D-I-D analysis, it is helpful to plot a small sample of pre and post outcome values, grouped by the exposure variable to get a feel for the overall data. A small random sample of 30 individuals from the analytic cohort is shown in Figure 4. From this plot, it is that the majority of the cohort had relatively high adherence in 2013 and that most patients had only small alterations in adherence during the study period. The overall impression is that those in the exposed group, those with the VBID Rx plan, may be increasing adherence slightly, while those without the plan are more likely to remain stable or decrease slightly.

5 How D-I-D you do that? Basic Difference-in-Differences Models in SAS®, continued

Figure 4. Plot of Pre-Post Medication Adherence by Exposure Group

Repeated Measures ANOVA Results For repeated measures ANOVA, the dataset is set up in “wide” format, with one observation per individual (Table 1). Each observation contains two variables for the value of the outcome measure, one each for the pre and post periods. The SAS code uses the GLM Procedure with the REPEATED statement. Study_ID Exposed Age_At_Index Female Race_Eth Adh_Pre Adh_Post 2 1 45 1 3 0.88667 0.97246 3 1 54 0 2 0.51238 0.46853 5 0 62 0 2 1.00000 0.99609 6 0 61 0 4 0.75047 0.71429 7 1 62 0 2 0.70299 0.68259 Table 1. Wide Format Data for D-I-D Analysis Using Repeated Measures ANOVA The SAS code uses the GLM Procedure with a REPEATED statement: /* UNADJUSTED REPEATED MEASURES ANOVA */ PROC GLM DATA = WIDE; CLASS EXPOSED; MODEL ADH_PRE ADH_POST = EXPOSED ; REPEATED TIME 2 / PRINTE MEAN; LSMEANS EXPOSED ; LSMEANS EXPOSED / ; FORMAT EXPOSED EXPOSED_GROUP.; TITLE2 "REPEATED MEASURES ANOVA FOR PRE/POST ADHERENCE BY EXPOSURE GROUP"; TITLE3 "UNADJUSTED: INCLUDING 'LEAST-SQUARES MEANS' ESTIMATES"; QUIT;

6 How D-I-D you do that? Basic Difference-in-Differences Models in SAS®, continued

/* ADJUSTED REPEATED MEASURES ANOVA */ PROC GLM DATA = WIDE; Class EXPOSED FEMALE RACE_ETH AGE_AT_INDEX; MODEL ADH_PRE ADH_POST = EXPOSED AGE_AT_INDEX FEMALE RACE_ETH ; REPEATED TIME 2 / PRINTE MEAN; LSMEANS EXPOSED ; LSMEANS EXPOSED / DIFF ; FORMAT EXPOSED EXPOSED_GROUP. AGE_AT_INDEX AGE_CAT. RACE_ETH RACE_ETH.; TITLE2 "REPEATED MEASURES ANOVA FOR PRE/POST ADHERENCE BY EXPOSURE GROUP"; TITLE3 "ADJUSTED: INCLUDING 'LEAST-SQUARES MEANS' ESTIMATES"; QUIT; This code generates Output 1 which includes estimates of the interaction term as well as pre and post mean adherence measures for each exposure group. Note that the two time period measures of adherence appear on the left side of the equals sign in the model statement. The name ‘TIME’ followed by the ‘2’ in the repeated statement indicates that there are two time points measured for each individual in the dataset, while the LSMEANS statement with the ‘/DIFF’ option requests that least-squares means be calculated for the factors listed, as well as for the differences between groups. Based on the output, the p-value of 0.0192 on the interaction term (time*exposed) indicates that the difference-in- differences in adherence change between the exposed and unexposed groups is likely different. The magnitude of the difference can be calculated from the LSMEANS results: those in the VBID plan group declined in adherence by roughly 0.2% (from 74.3% to 74.1%), while those in the non-VBID group declined in adherence by 2.3 % (76.1% down to 73.8%) for a difference-in-difference of 2.1%. The difference is significant at the α= 0.05 level, with a p-value of roughly 0.02. In other words, those with the VBID plan decreased adherence by 2.1% than those without the plan. The unadjusted ANOVA results suggest that, in this cohort, the slopes between 2013 and 2014 differ in the VBID and non-VBID groups. Unadjusted Model The GLM Procedure Repeated Measures Analysis of Variance MANOVA Criteria and Exact F Statistics for the Hypothesis of no TIME*EXPOSED Effect H = III SSCP Matrix for TIME*EXPOSED E = Error SSCP Matrix

S=1 M=-0.5 N=1239

Statistic Value F Value Num Den DF > F

Wilks' Lambda 0.99779235 5.49 1 2480 0.0192 Pillai's Trace 0.00220765 5.49 1 2480 0.0192 Hotelling-Lawley Trace 0.00221253 5.49 1 2480 0.0192 Roy's Greatest Root 0.00221253 5.49 1 2480 0.0192

Univariate Tests of Hypotheses for Within Subject Effects

Source DF Type III SS Mean Square F Value Pr > F

TIME 1 0.18550915 0.18550915 7.48 0.0063 TIME*EXPOSED 1 0.13615831 0.13615831 5.49 0.0192 Error(TIME) 2480 61.53966090 0.02481438

Least Squares Means ADH_PRE ADH_POST EXPOSED LSMEAN LSMEAN

Exposed 0.74256651 0.74078732 Unexposed 0.76124739 0.73819126 Output 1. Key Output from Unadjusted PROC GLM Repeated Measures ANOVA

7 How D-I-D you do that? Basic Difference-in-Differences Models in SAS®, continued

The adjusted ANOVA results summarized in Table 2 are similar, with a p-value of 0.0184 for the interaction term. However, the LSMEAN estimates differ because the distributions of the demographic variables in each exposure group are being taken into account in the adjusted least squares means results. The estimated D-I-D value of 2.2% is similar between the adjusted and unadjusted results, indicating that including these demographic variables in the MODEL statement makes little difference. Estimate Unadjusted Model Adjusted Model P-value for Interaction 0.0192 0.0184

Least Squares Means Unexposed 2013 76.1% 70.2% 2014 73.8% 69.7% Exposed 2013 74.3% 69.0% 2014 74.1% 68.9% Table 2. Summary Results from Repeated Measures ANOVA

Repeated Measures Regression Results When running the MIXED Procedure for a repeated measures linear model, the data need to be in “long format” with two lines per subject, one observation each for the pre and post periods. The exposed flag value is based on the exposure status in the post period – it does not change between periods. This means that all variables except the outcome measure and the flag indicating the post period measure are identical between records for a given study id, as shown in Table 3. Study_ID Exposed Post Age_At_Index Female Race_Eth Adh 2 1 0 45 1 3 0.88667 2 1 1 45 1 3 0.97246 3 1 0 54 0 2 0.51238 3 1 1 54 0 2 0.46853 5 0 0 62 0 2 1.00000 5 0 1 62 0 2 0.99609 Table 3. Long Format Data for D-I-D Analysis Using Repeated Measures ANOVA In the basic code for unadjusted and adjusted models, the SOLUTION option on the MODEL statement requests that the coefficient estimates be included in the output. The REPEATED statement identifies STUDY_ID as the unit with repeated measures. The TYPE = UN option calls for the unstructured covariance structure, as this structure resulted in the best model fit. A separate ESTIMATE statement for the D-I-D coefficient makes the intercept coefficient easy to in the output. Including the LSMEANS statement with /DIFF option generates estimates for all combinations of time and exposure as well as testing the significance of differences between the various time and exposure group combinations. If marginal least squares means are desired, the OBSMARGINS (OM) option can be specified in the LSMEANS statement. /*UNADJUSTED REPEATED MEASURES LINEAR REGRESSION*/ PROC MIXED DATA = LONG; CLASS POST EXPOSED; MODEL ADH=POST|EXPOSED / SOLUTION; LSMEANS POST|EXPOSED / DIFF; ESTIMATE 'D-I-D' EXPOSED*POST 1 -1 -1 1; RANDOM INT/SUBJECT=STUDY_ID TYPE=UN ; FORMAT EXPOSED EXPOSED_GROUP. POST PREPOST.; TITLE2 "RANDOM INTERCEPT MODEL FOR PRE/POST ADHERENCE by EXPOSURE GROUP"; TITLE3 "UNADJUSTED: INCLUDING LEAST-SQUARES MEANS ESTIMATES"; RUN;

8 How D-I-D you do that? Basic Difference-in-Differences Models in SAS®, continued

/*ADJUSTED REPEATED MEASURES LINEAR REGRESSION*/ PROC MIXED DATA = LONG; CLASS POST EXPOSED FEMALE AGE_AT_INDEX RACE_ETH; MODEL ADH=POST|EXPOSED FEMALE AGE_AT_INDEX RACE_ETH / SOLUTION; LSMEANS POST|EXPOSED / DIFF; ESTIMATE 'D-I-D' EXPOSED*POST 1 -1 -1 1; RANDOM Int/SUBJECT=STUDY_ID TYPE=UN ; FORMAT AGE_AT_INDEX AGE_CAT. RACE_ETH RACE_ETH. FEMALE FEMALE. EXPOSED EXPOSED_GROUP. POST PREPOST.; TITLE2 "RANDOM INTERCEPT MODEL FOR ADHERENCE: ADJUSTED"; TITLE2 "FOR SEX, AGE CATEGORY, AND RACE ETHNICITY"; RUN; Key sections of the output from the unadjusted model are shown in Output 2. In the output from the unadjusted repeated measures regression, the magnitude of the D-I-D coefficient is 1.86%, and it is significant at the α=0.05 level. Based on the coefficients from this linear model, adherence in the exposed group decreased by 0.57%, while that in the unexposed group decreased by 2.42%. In other words, having the VBID Rx plan appears to patients maintain adherence to medications for chronic conditions when facing increased deductibles, in contrast with patients who do not have the plan. As in the repeated measures ANOVA, the results are significant, although in the linear model the p-value is larger, while the effect of the VBID plan is slightly smaller.

The Mixed Procedure Solution for Fixed Effects

Standard Effect POST EXPOSED Estimate Error DF t Value Pr > |t|

Intercept 0.7614 0.007407 2480 102.80 <.0001 POST Post -0.02424 0.005858 2480 -4.14 <.0001 POST Pre 0 . . . . EXPOSED Exposed -0.01815 0.01153 2480 -1.57 0.1156 EXPOSED Unexposed 0 . . . . POST*EXPOSED Post Exposed 0.01857 0.009120 2480 2.04 0.0418 POST*EXPOSED Post Unexposed 0 . . . . POST*EXPOSED Pre Exposed 0 . . . . POST*EXPOSED Pre Unexposed 0 . . . .

Type 3 Tests of Fixed Effects

Num Den Effect DF DF F Value Pr > F

POST 1 2480 10.76 0.0011 EXPOSED 1 2480 0.61 0.4364 POST*EXPOSED 1 2480 4.15 0.0418

Estimates Standard Label Estimate Error DF t Value Pr > |t|

D-I-D 0.01857 0.009120 2480 2.04 0.0418

Least Squares Means Standard Effect POST EXPOSED Estimate Error DF t Value Pr > |t|

POST Post 0.7374 0.006480 2480 113.80 <.0001 POST Pre 0.7523 0.005766 2480 130.49 <.0001 EXPOSED Exposed 0.7404 0.008727 2480 84.84 <.0001 EXPOSED Unexposed 0.7493 0.007314 2480 102.45 <.0001 POST*EXPOSED Post Exposed 0.7376 0.009932 2480 74.26 <.0001 POST*EXPOSED Post Unexposed 0.7372 0.008324 2480 88.56 <.0001 POST*EXPOSED Pre Exposed 0.7433 0.008838 2480 84.10 <.0001 POST*EXPOSED Pre Unexposed 0.7614 0.007407 2480 102.80 <.0001

9 How D-I-D you do that? Basic Difference-in-Differences Models in SAS®, continued

The Mixed Procedure (cont’d) Differences of Least Squares Means

Standard Effect POST EXPOSED _POST _EXPOSED Estimate Error DF t Value Pr >|t|

POST Post Pre -0.0150 0.0046 2480 -3.28 0.0011 EXPOSED Exposed Unexposed -0.0089 0.0114 2480 -0.78 0.4364 POST*EXPOSED Post Exposed Post Unexposed 0.0004 0.0130 2480 0.03 0.9739 POST*EXPOSED Post Exposed Pre Exposed -0.0057 0.0070 2480 -0.81 0.4174 POST*EXPOSED Post Exposed Pre Unexposed -0.0238 0.0124 2480 -1.92 0.0547 POST*EXPOSED Post Unexposed Pre Exposed -0.0061 0.0121 2480 -0.50 0.6158 POST*EXPOSED Post Unexposed Pre Unexposed -0.0242 0.0059 2480 -4.14 <.0001 POST*EXPOSED Pre Exposed Pre Unexposed -0.0182 0.0115 2480 -1.57 0.1156 Output 2. Key Output from Unadjusted Repeated Measures Linear Regression

In the results summarized in Table 3, note that coefficient estimates for βpost and βinteraction are identical in both models. This is because the magnitude of the pre to post change among the unexposed and the exposed is not affected by adjustment for confounders: subjects serve as their own controls, and there are no time-varying predictors in this simple model. Adjustment for the distributions of the predictors may alter the intercept (β0) and the difference between the starting points of the exposed and unexposed groups (βExp), but it does not alter the trajectories of the individual exposure group lines. Estimate Unadjusted Model Adjusted Model Model Coefficients Intercept 0.7614 0.7614 Post -0.02424 -0.02424 Exposure -0.01815 -0.01815 Post*Exposure Interaction 0.01857 0.01857 Least Squares Means Unexposed 2013 76.1% 70.3% 2014 73.7% 67.9% Exposed 2013 74.3% 69.2% 2014 73.8% 68.6% Table 4. Summary Results from Repeated Measures Linear Regression Based on the adjusted repeated measures regression model summarized in Table 4, it appears that the addition of a VBID pharmacy benefits plan helps to protect medication adherence when moving from a no-deductible plan to a high deductible plan. While estimated adherence in the VBID group decreased slightly (from 69.2% to 68.6%, using least-squares means), adherence in the group without the VBID plan decreased 1.9% more, from 70.3% to 67.9%. This difference, while statistically significant, is not necessarily clinically relevant. However, because we used a D-I-D study design, we can interpret this difference in adherence as being caused by the implementation of the VBID plan and not by the change from a non-deductible to a deductible health plan.

CONCLUSION The paper presents two of the simplest analytic methods in SAS® for approaching modeling the Difference-in- Differences study design with a continuous outcome measure: repeated measures ANOVA using the GLM procedure and repeated measures linear regression using the MIXED procedure. The use of this study design is becoming more and more common in healthcare and medical research, as it allows researchers to analyze the outcomes of “natural experiments” that result from the introduction of new policies, treatments or other interventions in existing populations. In situations where an appropriate control group can be identified, this study design can generate results that can be interpreted causally, and thus it can be a powerful tool in observational research.

10 How D-I-D you do that? Basic Difference-in-Differences Models in SAS®, continued

REFERENCES  Reed, Mary. 2016. “Value-Based Insurance Designs: Medication Adherence After Switching to a Deductible Plan With Free Chronic Disease Medications.” Proceedings of the AcademyHealth Annual Research Meeting 2016.  Wolfinger, Russ and Chang, Ming. 1995. “Comparing the SAS® GLM and MIXED Procedures for Repeated Measures.” Proceedings of the SAS Global Users Group 1995 Conference 20. Cary, NC: SAS Institute, Inc. Available at https://support.sas.com/rnd/app/stat/papers/abstracts/mixedglm.html.

ACKNOWLEDGMENTS Many thanks to Dr. Mary Reed for allowing us to use the VBID Pharmacy RX study in this paper. We also appreciate the support of the Kaiser Permanente Northern California Community Benefits Program in funding the VBID research.

CONTACT INFORMATION Your comments and questions are valued and encouraged. Contact the author at: Name: Margaret Warton Enterprise: Kaiser Permanente Division of Research Address: 2000 Broadway, 4th Floor City, State ZIP: Oakland, CA 94612 Work Phone: 510-891-3129 Fax: 510-891-3600 E-: [email protected]

SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. Other brand and product names are trademarks of their respective companies.

11