cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
NeF
NeF
Level III

Difference in differences _DID or DD

Hello, 

How can I perform the difference in difference calculation in JMP?

Thanks,

Ne

1 REPLY 1

Re: Difference in differences _DID or DD

Hello @NeF 

 

For a categorical response, this should be addressed very well by my colleague @Mark_Bailey in this post: How to determine differences between each pair of categorical data with 3+ groups 

 

For a continuous response, the difference of the differences (DID or DD) is just a test of the interaction between two categorial variables (where each variable consists of just two levels). 

 

To do this, you will use the Fit Model platform in JMP.  Consider the following simple example, looking at the relationship between Age and Condition on Y: 

PatrickGiuliano_2-1645561894232.png

I have Age (Middle vs Younger) and Condition within Age (1 vs 2). 

 

Suppose I am interested in testing the whether the difference between Age = Middle at Condition 1 vs 2 is different from the difference between Age = Younger at Condition 1 vs 2.  Said differently, suppose I want to construct a hypothesis test on the Difference between Age Middle (2 - 1) and Age Younger (2 - 1) in relation to the Y response?

   

Again, this is just a test of the interaction between Age and Condition on Y.  In JMP, this interaction is captured by a term that is denoted as "Age*Condition."

 

To do this, I will go into Fit Model and Construct a Model adding the Age effect, Condition effect, and the Age by Condition Interaction effect.  You can see how to do this in this video if you're unfamiliar.

 

PatrickGiuliano_0-1645561797558.png  

 

PatrickGiuliano_1-1645561843094.png

Our results in this case indicate that the the DID is statistically significant at the 0.05 alpha level.  Said practically, the degree to which Condition (2 versus 1) depends on the level of Age (Younger vs Middle) is statistically significant. Graphically this is perhaps more intuitive and can be visualized in the Fit Model output (in the Effect Leverage report):

PatrickGiuliano_3-1645562083727.png

PatrickGiuliano_4-1645562161170.png

If we schematically represent the average effect of Age 'eliminating' Condition, we can see that this effect is statistically significant if we approximate the error bars on this effect (as being roughly similar to the error bars drawn at each Condition-by-Age Level):

PatrickGiuliano_5-1645562413828.png

Non-overlapping confidence intervals give us evidence of an effect in the population in much the same way that a statistically significant p-value (that is, a p-value < the level of alpha, typically 0.05) gives us such evidence. This is the "confidence interval version" of a 2-sample t-test (see Bluman, Elementary Statistics (7th edition), 2015).

 

Hope this helps!  @PatrickGiuliano