ETIA.CRV.adjustment package

Submodules

ETIA.CRV.adjustment.adjset_R module

read_adjset(csv_name, path_)[source]

Read the output csv file from R packages Author: kbiza@csd.uoc.gr :param csv_name (str): :type csv_name (str): the name of the file :param path_(str): :type path_(str): the path of the file

Returns:

adj_set(list or None)

Return type:

list if adjustment set exists, None if no adjustment set exists

adjset_pcalg(graph_pd, graph_type, x, y, r_path='R')[source]

Run the pcalg R package to identify the adjustment set of X and Y Author: kbiza@csd.uoc.gr Change R version in line 57 if needed :param graph_pd(pandas Dataframe): :param graph_type(str): :type graph_type(str): {‘dag’, ‘cpdag’, ‘mag’, ‘pag’} :param x(list): :type x(list): list of variable names :param y(list): :type y(list): list of variable names

Returns:

  • canonical_set(list) (the variable names of the canonical adj. set (if exists))

  • minimal_set(list):: the variable names of the minimal adj. set (if exists)

adjset_dagitty(graph_pd, graph_type, x_name, y_name, r_path='R')[source]

Run the dagitty R package to identify the adjustment set of X and Y Author: kbiza@csd.uoc.gr Change R version in line 92 if needed :param graph_pd: the graph as adjacency matrix :type graph_pd: pandas Dataframe :param graph_type: the type of the graph : {‘dag’, ‘cpdag’, ‘mag’, ‘pag’} :type graph_type: str :param x_name: list of variable names :type x_name: list :param y_name: list of variable names :type y_name: list

Returns:

the variable names of the canonical adj. set (if exists) minimal_set(list):: the variable names of the minimal adj. set (if exists)

Return type:

canonical_set(list)

ETIA.CRV.adjustment.function_find_adjset_daggity module

find_adjset(graph_pd, graph_type, target_name, exposure_names, r_path='R')[source]

Run the dagitty R package to identify the adjustment set of X and Y Author: kbiza@csd.uoc.gr :param graph_pd: the graph as adjacency matrix :type graph_pd: pandas Dataframe :param graph_type: the type of the graph : {‘dag’, ‘cpdag’, ‘mag’, ‘pag’} :type graph_type: str :param target_name: list of one variable name :param exposure_names: list of one or more variable names

Returns:

the variable names of the canonical adj. set (if exists) adj_set_min(list):: the variable names of the minimal adj. set (if exists)

Return type:

adj_set_can(list)