parse_effect: Parse text that defines a causal effect

View source: R/text-parsing.R

parse_effectR Documentation

Parse text that defines a causal effect

Description

Parse text that defines a causal effect

Usage

parse_effect(text)

Arguments

text

Character string

Value

A nested list that contains the following components:

vars

For each element of the causal query, this indicates potential outcomes as names of the list elements, the variables that they depend on, and the values that any variables are being fixed to.

oper

The vector of operators (addition or subtraction) that combine the terms of the causal query.

values

The values that the potential outcomes are set to in the query.

pcheck

List of logicals for each element of the query that are TRUE if the element is a potential outcome and FALSE if it is an observational quantity.

Examples

effectt <- "p{Y(X = 1) = 1} - p{Y(X = 0) = 1}"
parse_effect(text = effectt)

causaloptim documentation built on Nov. 2, 2023, 6:06 p.m.