trainingd <- backdoor$simulate(10000, return_simdata = TRUE)
newd <- backdoor$simulate(100, return_simdata = TRUE)
vnames <- backdoor$vnames
m1 <- lm(y ~ x + z, data = trainingd)
m2 <- lm(y ~ z, data = trainingd)
fairlist <- fairness(modellist = list(m1,m2),
scm = backdoor,
sensitive = c("x"),
sens_values = data.table::data.table(x=c(0,1)),
condition = newd[1,c("x","y")],
condition_type = list(x = "cont",
z = "cont",
y = "cont"),
parents = NULL,
n = 20,
modeltype = "predict",
method = "u_find")
Run the code above in your browser using DataLab