## See DAG in Figure 4 (a) in Stanghellini & Wermuth (2003)
d <- DAG(y1 ~ y3, y2 ~ y3 + y5, y3 ~ y4 + y5, y4 ~ y6)
checkIdent(d, "y3") # Identifiable
checkIdent(d, "y4") # Not identifiable
## See DAG in Figure 5 (a) in Stanghellini & Wermuth (2003)
d <- DAG(y1 ~ y5+y4, y2 ~ y5+y4, y3 ~ y5+y4)
checkIdent(d, "y4") # Identifiable
checkIdent(d, "y5") # Identifiable
## A simple function to check identifiability for each node
"is.ident" <-
function(gmat, compact=TRUE){
### Check suff. conditions marginalising on each node of a DAG.
a <- rownames(gmat)
for(i in a) {
b <- checkIdent(gmat, hidden=i)
if(compact)
b <- any(b)
cat("Node: ", i, "")
print(b)
}
}Run the code above in your browser using DataLab