Skip to content

Commit b9a30d1

Browse files
committed
Rel 0.1.0
1 parent f024b3e commit b9a30d1

15 files changed

Lines changed: 41 additions & 250 deletions

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
StructuralCausalModels.jl is part of the StatisticalRethinkingJulia eco system and, for now, containg functionality to analyse directed acyclic graph (DAG) based causal models as described in [StatisticalRethinking](https://xcelab.net/rm/statistical-rethinking/),[Causal Inference in Statistics](http://bcs.wiley.com/he-bcs/Books?action=index&bcsId=10288&itemId=1119186846) and [Cause and Correlation in Biology](https://www.cambridge.org/core/books/cause-and-correlation-in-biology/247799189B31939D24BC0F61FD59E9BB#).
1717

18-
My initial goal for this package is to have a way to apply SCM ideas to the examples in [StatisticalRethinking.jl](https://github.com/StatisticalRethinkingJulia), i.e. a working version of `d_separation()`, `basis_set()` and `adjustment_sets()`.
18+
My initial goal for this package is to have a way to apply SCM ideas to the examples in [StatisticalRethinking.jl](https://github.com/StatisticalRethinkingJulia), i.e. a working version of `basis_set()`, `d_separation()` and `adjustment_sets()`.
1919

2020
StructuralCausalModels.jl will be registered and, once registered, can be installed using
2121
`] add StructuralCausalModels`.
@@ -40,7 +40,8 @@ and particularly:
4040
4. Sadeghi, K. (2011). Stable classes of graphs containing directed acyclic
4141
graphs, implementation as included in ggm.
4242

43-
The latter two have been used as the basis for the Julia implementations of e.g. `shipley_test()`, `d_separation()` and `ancestral_graph()`.
43+
The latter two have been used as the basis for the Julia implementations of `basis_set()``d_separation()`, `shipley_test()`, `pcor_test()` and `ancestral_graph`.
44+
4445

4546
# References
4647

docs/src/introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
StructuralCausalModels.jl (SCM) is a Julia package to analyse directed acyclic graphs (DAGs) as described in [StatisticalRethinking](https://xcelab.net/rm/statistical-rethinking/), [Causal Inference in Statistics](http://bcs.wiley.com/he-bcs/Books?action=index&bcsId=10288&itemId=1119186846) and [Cause and Correlation in Biology](https://www.cambridge.org/core/books/cause-and-correlation-in-biology/247799189B31939D24BC0F61FD59E9BB#).
44

5-
My initial goal for this package is to have a way to apply SCM ideas to the examples in [StatisticalRethinking.jl](https://github.com/StatisticalRethinkingJulia), i.e. a working version of `d_separation()`, `adjustment_sets()` and `implied_conditional_independencies()`(still being developed).
5+
My initial goal for this package is to have a way to apply SCM ideas to the examples in [StatisticalRethinking.jl](https://github.com/StatisticalRethinkingJulia), i.e. a working version of `basis_set()`, `d_separation()`, `pcor_test()` and `adjustment_sets()`.
66

77
All three above references are great introductions to the use of causal models to help in understanding confounding in statistical models.
88

99
[StructuralCausalModels.jl](https://github.com/StatisticalRethinkingJulia/StructuralCausalModels.jl) is part of the [StatisticalRethinkingJulia](https://github.com/StatisticalRethinkingJulia) eco system. The package, once registered, can be installed using `] add StructuralCausalModels`.
1010

11-
Please report issues or file pull requests on Github if you find a problem.
11+
Please report issues (or file a pull request) on Github if you find a problem.

src/StructuralCausalModels.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ include("utils/ggm_conversions.jl")
5555
include("utils/dagitty_conversions.jl")
5656
include("utils/graphviz_conversions.jl")
5757

58-
include("test_methods/test_ag.jl")
59-
60-
#include("methods/all_edges.jl")
61-
6258
export
6359
scm_path
6460

src/methods/all_edges.jl

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/not_used/convert2csv.jl

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/not_used/doc_template.jl

Lines changed: 0 additions & 89 deletions
This file was deleted.

test/runtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ end
3535

3636
include("test_sr6_4_3b.jl")
3737
include("test_ag.jl")
38-
include("test_agb.jl")
39-
include("test_dag.jl")
38+
include("test_set_dag_df.jl")
39+
include("test_dag_formulations.jl")
4040
include("test_dagitty_conversion.jl")
4141
include("test_ggm_conversion.jl")
4242
include("test_graphviz_conversions.jl")

test/test_ag.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ using StructuralCausalModels, Test
22

33
ProjDir = @__DIR__
44

5-
#include(scm_path("test_methods", "test_ag.jl"))
5+
include(scm_path("..", "test", "test_methods", "test_ag.jl"))
66

77
amat_data = transpose(reshape([
88
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@@ -36,12 +36,12 @@ Sys.isapple() && run(`open -a GraphViz.app $(fn)`)
3636
m = [:n3, :n5, :n6, :n15, :n16];
3737
c = [:n4, :n7];
3838

39-
fr = StructuralCausalModels.test_ag(a; m=m, c=c)
39+
fr = test_ag(a; m=m, c=c)
4040

4141
fr1 = ancestral_graph(a; m=m, c=c)
4242
@test all(fr .== fr1)
4343

44-
fr2 = StructuralCausalModels.test_ag(dag.a; m=m, c=c)
44+
fr2 = test_ag(dag.a; m=m, c=c)
4545
@test all(fr .== fr2);
4646

4747
println()

test/test_dag.jl

Lines changed: 0 additions & 116 deletions
This file was deleted.

test/test_dag_formulations.jl

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using StructuralCausalModels, Test
2+
3+
d1 =OrderedDict(
4+
[:u, :w] => :v,
5+
[:u] => :x,
6+
:s1 => [:u],
7+
:w => :y,
8+
[:s2] => [:w]
9+
)
10+
11+
e1 = StructuralCausalModels.edge_matrix(d1)
12+
13+
d2 = OrderedDict(
14+
:u => [:x, :v],
15+
:s1 => [:u],
16+
:w => [:v, :y],
17+
:s2 => [:w]
18+
);
19+
20+
e2 = StructuralCausalModels.edge_matrix(d2)
21+
22+
@testset "dag_formulations" begin
23+
24+
syms = names(e, 1)
25+
for s1 in syms
26+
for s2 in syms
27+
@test e1[s1, s2] == e2[s1, s2]
28+
end
29+
end
30+
31+
end

0 commit comments

Comments
 (0)