Skip to content

Commit dfca444

Browse files
committed
Added test coverage
1 parent bef9d63 commit dfca444

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/test_inference.jl

+7-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ lb2, ub2 = CausalELM.confidence_interval(dm_inference, dm.causal_effect)
2121
summary2 = summarize(dm, n=100)
2222

2323
# With a continuous treatment variable
24-
dm_continuous = DoubleMachineLearning(x, t, rand(1:4, 100))
24+
dm_continuous = DoubleMachineLearning(x, rand(1:4, 100), y)
2525
estimate_causal_effect!(dm_continuous)
2626
dm_continuous_inference = CausalELM.generate_null_distribution(dm_continuous, 100)
2727
p3, stderr3 = CausalELM.p_value_and_std_err(
@@ -36,6 +36,7 @@ x₀, y₀, x₁, y₁ = rand(1:100, 500, 5), randn(500), randn(100, 5), randn(1
3636
its = InterruptedTimeSeries(x₀, y₀, x₁, y₁)
3737
estimate_causal_effect!(its)
3838
summary4 = summarize(its, n=100)
39+
summary4_mean = summarize(its, mean_effect=true)
3940
summary4_inference = summarize(its, n=100, inference=true)
4041

4142
# Null distributions for the mean and cummulative changes
@@ -169,6 +170,11 @@ end
169170
@test !isnothing(v)
170171
end
171172

173+
# Interrupted Time Series with mean effect
174+
for (k, v) in summary4_mean
175+
@test !isnothing(v)
176+
end
177+
172178
# Interrupted Time Series with randomization inference
173179
@test summary4_inference["Standard Error"] !== NaN
174180
@test summary4_inference["p-value"] !== NaN

0 commit comments

Comments
 (0)