Learn R Programming

dlsem (version 1.0)

isIndep: Check conditional independence

Description

Check conditional independence among two variables.

Usage

isIndep(x, var1, var2, given = NULL, conf = 0.95)

Arguments

x
An object of class dlsem.
var1
The name of the first variable.
var2
The name of the second variable.
given
A vector containing the names of conditioning variables. If NULL, marginal independence is checked.
conf
The confidence level for edges in the object of class dlsem. Default is 0.95.

Value

  • Logical

References

J. Pearl (2000). Causality: Models, Reasoning, and Inference. Cambridge University Press. Cambridge, UK.

See Also

dlsem

Examples

Run this code
data(agres)
mycode <- list(
  GVA~quec(NPATENT,0,4),
  PPI~quec(NPATENT,0,6)+quec(GVA,0,10),
  ENTR_INCOME~quec(NPATENT,0,3)+quec(GVA,1,10)
  )
mod0 <- dlsem(mycode,group="COUNTRY",context=c("GDP","FARM_SIZE"),
  data=agres,uniroot.check=TRUE,imputation=FALSE,log=TRUE)
isIndep(mod0,"NPATENT","ENTR_INCOME",given=c("GVA","PPI"))

Run the code above in your browser using DataLab