Tuesday, February 14, 2017

A simple DAG

According to a discussion on SEMNET, the model below 'lacks any testable implications' or one 'cannot detect any testable implications', URL.

I like to 'see' things before deciding, so I submitted it to daggityR, simple task in fact, see code below, but 1st the visual ('plot', called in R), and its 'implications' (called 'impliedConditionalIndependencies' in R); this happens to be the simplest' mediation (called Barron-Kenny, BK, see Frontiers commentary for clarifications).
impliedConditionalIndependencies(NoImplic)

M _||_ UX | X
M _||_ UY
UM _||_ UX
UM _||_ UY
UM _||_ X
UM _||_ Y | M, X
UX _||_ UY
UX _||_ Y | X
UY _||_ X

adjustmentSets( NoImplic, "X", "Y", type="all" )

 {}
 { UM }
 { UX }
 { UM, UX }
 { UY }
 { UM, UY }
 { UX, UY }
 { UM, UX, UY }

adjustmentSets( NoImplic, "M", "Y", type="all" )

 { X }
 { UM, X }
 { UX, X }
 { UM, UX, X }
 { UY, X }
 { UM, UY, X }
 { UX, UY, X }
 { UM, UX, UY, X }

# how to build it:
library(dagitty)

NoImplic <- dagitty('dag {
UX [pos="0,1"]
X [pos="1,1"]
UM [pos="1,0"]
M [pos="2,0"]
UY [pos="2.5,1.5"]
Y [pos="3,1"]
UX-> X -> M ->Y <- X
UM -> M
UY -> Y
}')
plot(NoImplic)

~~~~~~~~
Coman, E. N., F. Thoemmes and J. Fifield (2017). Commentary: Causal Effects in Mediation Modeling: An Introduction with Applications to Latent Variables. Frontiers in Psychology 8(151). http://journal.frontiersin.org/article/10.3389/fpsyg.2017.00151/full

Monday, February 6, 2017

DAGs-simple

A recent paper (Fischer,  Dietz, & Antonakis, 2017) proposed a 'specious mediation' model, which is one combination of causal effects flowing in a peculiar pattern; the 'causal story' is told like:
"As an example, perceived justice has been found to mediate the impact of monitoring methods on organizational citizenship behavior (Niehoff & Moorman, 1993). An alternative mediator is trust in the supervisor (Pillai, Schriesheim, & Williams, 1999), which is likely also affected by monitoring and related to perceived justice. Then, if trust but not justice perceptions affected organizational citizenship behaviors, justice perceptions would appear as a significant mediator if trust is not included in the model. Findings from the model excluding trust are not interpretable, because the effect of trust on the parameter estimate for perceived justice is unknown: Perceived justice might be a mediator, although likely with less of an impact than what the estimate suggests, or worse, it might be a specious mediator.
Such a specious mediator can be uncovered only by including true and correlated mediators,such as trust in the model. Given that a cause such as monitoring might have a multitude of proximal effects that are also correlated with trust and perceived justice and that have an effect on organizational citizenship behavior, the risk of ignoring relevant mediators and detecting specious mediators is highly prevalent." [p. 15-16]

Hope I captured it well... One can inspect such DAGs formally, and easily, with daggityR, see code below, see then what it can tell us beyond the informal analysis above.

Here's the original figure, and the R generated one (I took the liberty of labeling in Fig. 4 the variable names from the example, hope they match, although some statements above make me pause, like "perceived justice has been found to mediate the impact of monitoring methods on organizational citizenship behavior", so this is (and then not) a mediator, plus " trust in the supervisor [..is.]  related to perceived justice.", yet the figure says they appear 'related' only because of common cause 'Omitted').



#if daggity is not installed, there, you need to install it
install.packages("dagitty")

#this line below calls the daggity module up
library(dagitty)


# Fischer '17 specious mediation
# the 1st 6 lines simply position variables in a bi-dimensional Y(X) space, you can move them around
#I positioned Omitted to the left of 'mediators' because it is a cause of them

SpeciousF <- dagitty('dag {
Monitoring [pos="0,1"]
PerceivedJustice [pos="2,2"]
TrustinSupervisor [pos="2,0"]
Omitted  [pos="1,1"]
OrgCitizenshipBehavior [pos="3,1"]
#these next 3 lines specify the causal structure, which-causes-which
Monitoring   -> TrustinSupervisor -> OrgCitizenshipBehavior  <- Omitted
TrustinSupervisor <- Omitted
Monitoring  -> PerceivedJustice<- Omitted
}')

# now you can plot the DAG you just created above, see below figure
plot(SpeciousF )




# one can inspect implications of the DAG below
> impliedConditionalIndependencies( SpeciousF )

#there are a few independencies implied by the DAG below:

Monitoring _||_ Omitted
Monitoring _||_ OrgCitizenshipBehavior | Omitted, TrustinSupervisor
OrgCitizenshipBehavior _||_ PerceivedJustice | Monitoring, Omitted
OrgCitizenshipBehavior _||_ PerceivedJustice | Omitted, TrustinSupervisor
PerceivedJustice _||_ TrustinSupervisor | Monitoring, Omitted

#this shows what you HAVE to adjust to estimate the causal effect of Monitoring on OrgCitizenshipBehavior, with {} meaning 'nothing"

adjustmentSets( SpeciousF, "Monitoring", "OrgCitizenshipBehavior ", type="all" )
> adjustmentSets( SpeciousF, "Monitoring", "OrgCitizenshipBehavior", type="all" )
 {}
 { Omitted }
 { Omitted, PerceivedJustice }


Fischer, T., Dietz, J., & Antonakis, J. , 2017, Leadership Process Models. Journal of Management, 0(0), 0149206316682830. http://dx.doi.org/10.1177/0149206316682830