ipc: Estimate an IDAG

Description Usage Arguments Value Examples

View source: R/ipcalg.R

Description

Estimate an IDAG for the causal effect of x on y from a fitted PC function.

Usage

1
ipc(pc.fit, data, x, y, alpha = 0.01)

Arguments

pc.fit

fitted PC object

data

dataset

x

intervention

y

outcome

alpha

significance level for regressions

Value

fitted IPC object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
library(tibble)
library(pcalg)
n <- 1000
data <- tibble::tibble(
  A = rnorm(n),
  B = rnorm(n),
  Y = A + B + A * B + rnorm(n)
)

pc.fit <- pc(
  suffStat = list(C = cor(data), n = nrow(data)),
  indepTest = gaussCItest,
  alpha = 0.01,
  labels = colnames(data)
)

ipc.fit <- ipc(pc.fit, data, x = 'A', y = 'Y', alpha = 0.01)

dhessing/ipcalg documentation built on Dec. 19, 2021, 11:07 p.m.