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

Thursday, December 29, 2016

Single/multiple and cause/effect indicators

A brief visual note on the possibility of combining cause and effect indicators of latent variables (LV). Ken Bollen noted this possibility of a LV with 1 of each type of indicators in 1984 (evidently this model is not identified as such):

He mentioned such 'mixed' measures several times, see e.g. the depression CES-D one:
"items appear to be a mixture of effect and causal indicators. For instance, "I felt depressed" and "I felt sad" appear to be effect indicators of depressed mood. That is, we expect that a change in the latent depression variable leads to a change in responses to these items. However, "I felt lonely" could be a causal indicator of the same construct in that loneliness may cause depression rather than vice versa. Alternatively, loneliness could be a separate dimension that requires several indicators to measure it. To further complicate things, one could argue that some items are reciprocally related to depression.
For example, individuals may become depressed because they think people dislike them, which makes them appear unattractive, thus other people may avoid them and actually dislike them (i.e., the low affect may be unattractive and offputting)." [1:311]

Note 1:
Les Hayduk explored the 'reciprocally related' ('reactive') indicators in detail in [5]:

Note 2:
Les also advanced the 'finite cycling' feedback/nonrecursive models in [6], which simply says that infinite cycling is not realistic, so one can conceive of: 1. 1 full cycle; 2. 1 & 1/2 cycle; 3. 2 full cycles; etc. (although more than 2 cycles around the effects add up very little). See also in this [6]  great language on why/how one splits an effect η1 -> η2 into 2 such effects, see below the quote, referring to his Fig. 1 below:




“To identify the estimates of the effects in a model like Figure 1 (in the absence of additional equality, proportionality, or other constraints on β21 and β12) a variable like ξ1 is required (Rigdon, 1995). The direct effect of ξ1 on η1, and the important absence of a direct effect of ξ1 on η2, implies that the covariance between ξ1 on η2 arises from the basic indirect effect of ξ1 on η2 (namely γ11 β21), which is enhanced by the loop L = β21 β12. The relegation of β12 to a purely enhancing role in accounting for the covariance between ξ1 and η2 differentiates or disentangles β21 from β12 and makes it possible to obtain separate estimates of these effects. In the Figure 1 model, ξ2 similarly contributes to disentangling the reciprocal effects, so as long as the γ11 and γ22 effects are substantial, the β21 and β12 effects in this model should be overidentified (given the independence of the disturbance terms).” [6: 660-661].


1. Bollen, K. A., & Lennox, R. (1991). Conventional wisdom on measurement: A structural equation perspective. Psychological Bulletin, 110(2), 305-314. doi:10.1037/0033-2909.110.2.305
2. Bollen, K. (1984). Multiple indicators: internal consistency or no necessary relationship? Quality and Quantity, 18(4), 377-385.
3. Bollen, K. A., Glanville, J. L., & Stecklov, G. (2001). Socioeconomic status and class in studies of fertility and health in developing countries. Annual Review of Sociology, 153-185.
4. Bollen, K. A., & Bauldry, S. (2011). Three Cs in measurement models: Causal indicators, composite indicators, and covariates. Psychological Methods, 16(3), 265-284. doi:10.1037/a0024448
5. Hayduk, L. A., Robinson, H. P., Cummings, G. G., Boadu, K., Verbeek, E. L., & Perks, T. A. (2007). The weird world, and equally weird measurement models: Reactive indicators and the validity revolution. Structural Equation Modeling: A Multidisciplinary Journal, 14(2), 280-310. 
6. Hayduk, L. A. (2009). Finite Feedback Cycling in Structural Equation Models. Structural Equation Modeling: A Multidisciplinary Journal, 16(4), 658-675. 

Monday, November 7, 2016

'Causal' mediation great intro

I came across this great writing, which tackles 2 complex topics, causal mediation, and then this g-formula, not an easy feat...

They present a sweeping overview of current 'causal' mediation understanding, wonderfully summarized in some tables, especially 1:

and 2 (a bit 'thicker' for newcomers...)

* Note that g-formula has been incorporated in Stata (SAS too), see: http://www.stata-journal.com/article.html?article=st0238 .

References:
Wang, A., & Arah, O. A. (2015). G-computation demonstration in causal mediation analysis. European Journal of Epidemiology, 30(10), 1119-1127. doi: 10.1007/s10654-015-0100-z http://link.springer.com/article/10.1007/s10654-015-0100-z
Daniel RM, De Stavola BL, Cousens SN. gformula: estimating causal effects in the presence of time-varying confounding or mediation using the g-computation formula. Stata J. 2011;11(4):
479–517.

Wednesday, August 24, 2016

Causal hypotheses:from qualitative to quantitative (SEM style)

The statistical testing of hypotheses about causal sequencing of variables seems to more clearly show nowadays the 2-step process directly stated in Ch. 10 in Conrady & Jouffe, (chapter written with Felix Elwert), process mentioned in my Semnet posting:
1. Causal Identification, followed by
2. Computing the Effect Size.

I found a good example of this approach, within the SEM (Structural Equation Modeling) approach, in a a recent article in Computers in Human Behavior, by Yen & Wu, the sequence is simply: 1. A 'qualitative' (i.e. no numbers!) part: how variables/concepts are expected to 'string themselves' out; and 2. A quantitative part, the post-SEM estimation phase, with numbers attached this time.
1.What one expects:
 2. What one finds (numerically):
References:
Conrady, S. and L. Jouffe, Bayesian Networks and BayesiaLab: 
A Practical Introduction for Researchers. 2015: Bayesia USA: 
free online: http://www.bayesia.com/book
Yen, Y.-S., & Wu, F.-S. (2016). Predicting the adoption of mobile financial services: 
The impacts of perceived mobility and personal habit. Computers in Human Behavior, 
65, 31-42. doi: http://dx.doi.org/10.1016/j.chb.2016.08.017 

Thursday, July 14, 2016

Mediation: from 3 variables to 6 and 27 models

We all know the 3 variable model (X->M->Y & X->Y) with M being an intermediate variable (hence both cause and effect) is 'the simplest' possible 'statistical model', besides the bare-bone 2 variable one (X->Y).
Many have delved into its intricacies however, which are many in fact, dealing with specification alternatives. For instance, as Felix Thoemmes e.g. showed, there are 6 alternative statistically indistinguishable models that link all 3 variables (these are then all 'saturated models': no test of fit to data in SEM can be done).


Another take on this is the Conrady & Jouffe (2015) display of all 27 possible causal specifications one may contemplate when analyzing such 'simple' model (They use N1, N2, N3): this makes clear that the researcher/analyst 'gets married' to a specific causal structure s/he believes to operate behind the data, i.e. that generated it; In BayesiaLab this is obvious by asking the user for direct input ('drawing an arrow', much like in AMOS).


Of course, with >3 variables, the number of possibilities quickly get out of hand! Some can be ruled out by theory and prior findings, others by 'hunches', others by 'strong beliefs' (more so the case in practice, I'd say).

Conrady, S., & Jouffe, L. (2015). Bayesian Networks and BayesiaLab: A Practical Introduction for Researchers. http://www.bayesia.com/book
Thoemmes, F. (2015). Reversing Arrows in Mediation Models Does Not Distinguish Plausible Models. Basic and Applied Social Psychology, 37(4), 226-234. doi:10.1080/01973533.2015.1049351 www.tandfonline.com/doi/pdf/10.1080/01973533.2015.1049351

Thursday, April 21, 2016

nested_CF-s

Here is the worked example from the article below; they showed how to 'process' such data, in the classical manner (standard adjustment), and in the causal modeling way (structured adjustment). Very simple side-by-side application.

Kaufman, J. S., & Kaufman, S. (2001). Assessment of Structured Socioeconomic Effects on Health. Epidemiology, 12(2), 157-167. doi:10.2307/3703617