Skip to content

Commit

Permalink
build based on 926fe74
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Dec 27, 2023
1 parent 143e6ca commit 0599e83
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion dev/contributing/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/guide/doublemachinelearning/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
X, Xₚ, Y, T = rand(100, 5), rand(100, 4), rand(100), [rand()<0.4 for i in 1:100]

dml = DoubleMachineLearning(X, Xₚ, Y, T)</code></pre><h2 id="Step-2:-Estimate-the-Causal-Effect"><a class="docs-heading-anchor" href="#Step-2:-Estimate-the-Causal-Effect">Step 2: Estimate the Causal Effect</a><a id="Step-2:-Estimate-the-Causal-Effect-1"></a><a class="docs-heading-anchor-permalink" href="#Step-2:-Estimate-the-Causal-Effect" title="Permalink"></a></h2><p>To estimate the causal effect, we call estimatecausaleffect! on the model above.</p><pre><code class="language-julia hljs"># we could also estimate the ATT by passing quantity_of_interest=&quot;ATT&quot;
estimate_causal_effect!(dml)</code></pre><h1 id="Get-a-Summary"><a class="docs-heading-anchor" href="#Get-a-Summary">Get a Summary</a><a id="Get-a-Summary-1"></a><a class="docs-heading-anchor-permalink" href="#Get-a-Summary" title="Permalink"></a></h1><p>We can get a summary that includes a p-value and standard error estimated via asymptotic randomization inference by passing our model to the summarize method.</p><pre><code class="language-julia hljs">summarize(dml)</code></pre><h2 id="Step-4:-Validate-the-Model"><a class="docs-heading-anchor" href="#Step-4:-Validate-the-Model">Step 4: Validate the Model</a><a id="Step-4:-Validate-the-Model-1"></a><a class="docs-heading-anchor-permalink" href="#Step-4:-Validate-the-Model" title="Permalink"></a></h2><p>We can validate the model by examining the plausibility that the main assumptions of causal inference, counterfactual consistency, exchangeability, and positivity, hold. It should be noted that consistency and exchangeability are not directly testable, so instead, these tests do not provide definitive evidence of a violation of these assumptions. To probe the counterfactual consistency assumption, we assume there were multiple levels of treatments and find them by binning the dependent vairable for treated observations using Jenks breaks. The optimal number of breaks between 2 and num_treatments is found using the elbow method. Using these hypothesized treatment assignemnts, this method compares the MSE of linear regressions using the observed and hypothesized treatments. If the counterfactual consistency assumption holds then the difference between the MSE with hypothesized treatments and the observed treatments should be positive because the hypothesized treatments should not provide useful information. If it is negative, that indicates there was more useful information provided by the hypothesized treatments than the observed treatments or that there is an unobserved confounder. Next, this methods tests the model&#39;s sensitivity to a violation of the exchangeability assumption by calculating the E-value, which is the minimum strength of association, on the risk ratio scale, that an unobserved confounder would need to have with the treatment and outcome variable to fully explain away the estimated effect. Thus, higher E-values imply the model is more robust to a violation of the exchangeability assumption. Finally, this method tests the positivity assumption by estimating propensity scores. Rows in the matrix are levels of covariates that have a zero probability of treatment. If the matrix is empty, none of the observations have an estimated zero probability of treatment, which implies the positivity assumption is satisfied.</p><p>For a thorough review of casual inference assumptions see: Hernan, Miguel A., and James M. Robins. Causal inference what if. Boca Raton: Taylor and Francis, 2024. </p><p>For more information on the E-value test see: VanderWeele, Tyler J., and Peng Ding. &quot;Sensitivity analysis in observational research: introducing the E-value.&quot; Annals of internal medicine 167, no. 4 (2017): 268-274.</p><pre><code class="language-julia hljs">validate(g_computer)</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../gcomputation/">« G-computation</a><a class="docs-footer-nextpage" href="../metalearners/">Metalearners »</a><div class="flexbox-break"></div><p class="footer-message">© 2023 Darren Colby</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.24 on <span class="colophon-date" title="Wednesday 27 December 2023 16:10">Wednesday 27 December 2023</span>. Using Julia version 1.8.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
estimate_causal_effect!(dml)</code></pre><h1 id="Get-a-Summary"><a class="docs-heading-anchor" href="#Get-a-Summary">Get a Summary</a><a id="Get-a-Summary-1"></a><a class="docs-heading-anchor-permalink" href="#Get-a-Summary" title="Permalink"></a></h1><p>We can get a summary that includes a p-value and standard error estimated via asymptotic randomization inference by passing our model to the summarize method.</p><pre><code class="language-julia hljs">summarize(dml)</code></pre><h2 id="Step-4:-Validate-the-Model"><a class="docs-heading-anchor" href="#Step-4:-Validate-the-Model">Step 4: Validate the Model</a><a id="Step-4:-Validate-the-Model-1"></a><a class="docs-heading-anchor-permalink" href="#Step-4:-Validate-the-Model" title="Permalink"></a></h2><p>We can validate the model by examining the plausibility that the main assumptions of causal inference, counterfactual consistency, exchangeability, and positivity, hold. It should be noted that consistency and exchangeability are not directly testable, so instead, these tests do not provide definitive evidence of a violation of these assumptions. To probe the counterfactual consistency assumption, we assume there were multiple levels of treatments and find them by binning the dependent vairable for treated observations using Jenks breaks. The optimal number of breaks between 2 and num_treatments is found using the elbow method. Using these hypothesized treatment assignemnts, this method compares the MSE of linear regressions using the observed and hypothesized treatments. If the counterfactual consistency assumption holds then the difference between the MSE with hypothesized treatments and the observed treatments should be positive because the hypothesized treatments should not provide useful information. If it is negative, that indicates there was more useful information provided by the hypothesized treatments than the observed treatments or that there is an unobserved confounder. Next, this methods tests the model&#39;s sensitivity to a violation of the exchangeability assumption by calculating the E-value, which is the minimum strength of association, on the risk ratio scale, that an unobserved confounder would need to have with the treatment and outcome variable to fully explain away the estimated effect. Thus, higher E-values imply the model is more robust to a violation of the exchangeability assumption. Finally, this method tests the positivity assumption by estimating propensity scores. Rows in the matrix are levels of covariates that have a zero probability of treatment. If the matrix is empty, none of the observations have an estimated zero probability of treatment, which implies the positivity assumption is satisfied.</p><p>For a thorough review of casual inference assumptions see: Hernan, Miguel A., and James M. Robins. Causal inference what if. Boca Raton: Taylor and Francis, 2024. </p><p>For more information on the E-value test see: VanderWeele, Tyler J., and Peng Ding. &quot;Sensitivity analysis in observational research: introducing the E-value.&quot; Annals of internal medicine 167, no. 4 (2017): 268-274.</p><pre><code class="language-julia hljs">validate(g_computer)</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../gcomputation/">« G-computation</a><a class="docs-footer-nextpage" href="../metalearners/">Metalearners »</a><div class="flexbox-break"></div><p class="footer-message">© 2023 Darren Colby</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.24 on <span class="colophon-date" title="Wednesday 27 December 2023 20:38">Wednesday 27 December 2023</span>. Using Julia version 1.8.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/guide/gcomputation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
X, Y, T = rand(1000, 5), rand(1000), [rand()&lt;0.4 for i in 1:1000]

g_computer = GComputation(X, Y, T)</code></pre><h2 id="Step-2:-Estimate-the-Causal-Effect"><a class="docs-heading-anchor" href="#Step-2:-Estimate-the-Causal-Effect">Step 2: Estimate the Causal Effect</a><a id="Step-2:-Estimate-the-Causal-Effect-1"></a><a class="docs-heading-anchor-permalink" href="#Step-2:-Estimate-the-Causal-Effect" title="Permalink"></a></h2><p>To estimate the causal effect, we pass the model above to estimatecausaleffect!.</p><pre><code class="language-julia hljs"># Note that we could also estimate the ATT by setting quantity_of_interest=&quot;ATT&quot;
estimate_causal_effect!(g_computer)</code></pre><h2 id="Step-3:-Get-a-Summary"><a class="docs-heading-anchor" href="#Step-3:-Get-a-Summary">Step 3: Get a Summary</a><a id="Step-3:-Get-a-Summary-1"></a><a class="docs-heading-anchor-permalink" href="#Step-3:-Get-a-Summary" title="Permalink"></a></h2><p>We get a summary of the model that includes a p-value and standard error estimated via asymptotic randomization inference by passing our model to the summarize method.</p><pre><code class="language-julia hljs">summarize(g_computer)</code></pre><h2 id="Step-4:-Validate-the-Model"><a class="docs-heading-anchor" href="#Step-4:-Validate-the-Model">Step 4: Validate the Model</a><a id="Step-4:-Validate-the-Model-1"></a><a class="docs-heading-anchor-permalink" href="#Step-4:-Validate-the-Model" title="Permalink"></a></h2><p>We can validate the model by examining the plausibility that the main assumptions of causal inference, counterfactual consistency, exchangeability, and positivity, hold. It should be noted that consistency and exchangeability are not directly testable, so instead, these tests do not provide definitive evidence of a violation of these assumptions. To probe the counterfactual consistency assumption, we assume there were multiple levels of treatments and find them by binning the dependent vairable for treated observations using Jenks breaks. The optimal number of breaks between 2 and num_treatments is found using the elbow method. Using these hypothesized treatment assignemnts, this method compares the MSE of linear regressions using the observed and hypothesized treatments. If the counterfactual consistency assumption holds then the difference between the MSE with hypothesized treatments and the observed treatments should be positive because the hypothesized treatments should not provide useful information. If it is negative, that indicates there was more useful information provided by the hypothesized treatments than the observed treatments or that there is an unobserved confounder. Next, this methods tests the model&#39;s sensitivity to a violation of the exchangeability assumption by calculating the E-value, which is the minimum strength of association, on the risk ratio scale, that an unobserved confounder would need to have with the treatment and outcome variable to fully explain away the estimated effect. Thus, higher E-values imply the model is more robust to a violation of the exchangeability assumption. Finally, this method tests the positivity assumption by estimating propensity scores. Rows in the matrix are levels of covariates that have a zero probability of treatment. If the matrix is empty, none of the observations have an estimated zero probability of treatment, which implies the positivity assumption is satisfied.</p><p>For a thorough review of casual inference assumptions see: Hernan, Miguel A., and James M. Robins. Causal inference what if. Boca Raton: Taylor and Francis, 2024. </p><p>For more information on the E-value test see: VanderWeele, Tyler J., and Peng Ding. &quot;Sensitivity analysis in observational research: introducing the E-value.&quot; Annals of internal medicine 167, no. 4 (2017): 268-274.</p><pre><code class="language-julia hljs">validate(g_computer)</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../its/">« Interrupted Time Series Estimation</a><a class="docs-footer-nextpage" href="../doublemachinelearning/">Double Machine Learning »</a><div class="flexbox-break"></div><p class="footer-message">© 2023 Darren Colby</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.24 on <span class="colophon-date" title="Wednesday 27 December 2023 16:10">Wednesday 27 December 2023</span>. Using Julia version 1.8.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
estimate_causal_effect!(g_computer)</code></pre><h2 id="Step-3:-Get-a-Summary"><a class="docs-heading-anchor" href="#Step-3:-Get-a-Summary">Step 3: Get a Summary</a><a id="Step-3:-Get-a-Summary-1"></a><a class="docs-heading-anchor-permalink" href="#Step-3:-Get-a-Summary" title="Permalink"></a></h2><p>We get a summary of the model that includes a p-value and standard error estimated via asymptotic randomization inference by passing our model to the summarize method.</p><pre><code class="language-julia hljs">summarize(g_computer)</code></pre><h2 id="Step-4:-Validate-the-Model"><a class="docs-heading-anchor" href="#Step-4:-Validate-the-Model">Step 4: Validate the Model</a><a id="Step-4:-Validate-the-Model-1"></a><a class="docs-heading-anchor-permalink" href="#Step-4:-Validate-the-Model" title="Permalink"></a></h2><p>We can validate the model by examining the plausibility that the main assumptions of causal inference, counterfactual consistency, exchangeability, and positivity, hold. It should be noted that consistency and exchangeability are not directly testable, so instead, these tests do not provide definitive evidence of a violation of these assumptions. To probe the counterfactual consistency assumption, we assume there were multiple levels of treatments and find them by binning the dependent vairable for treated observations using Jenks breaks. The optimal number of breaks between 2 and num_treatments is found using the elbow method. Using these hypothesized treatment assignemnts, this method compares the MSE of linear regressions using the observed and hypothesized treatments. If the counterfactual consistency assumption holds then the difference between the MSE with hypothesized treatments and the observed treatments should be positive because the hypothesized treatments should not provide useful information. If it is negative, that indicates there was more useful information provided by the hypothesized treatments than the observed treatments or that there is an unobserved confounder. Next, this methods tests the model&#39;s sensitivity to a violation of the exchangeability assumption by calculating the E-value, which is the minimum strength of association, on the risk ratio scale, that an unobserved confounder would need to have with the treatment and outcome variable to fully explain away the estimated effect. Thus, higher E-values imply the model is more robust to a violation of the exchangeability assumption. Finally, this method tests the positivity assumption by estimating propensity scores. Rows in the matrix are levels of covariates that have a zero probability of treatment. If the matrix is empty, none of the observations have an estimated zero probability of treatment, which implies the positivity assumption is satisfied.</p><p>For a thorough review of casual inference assumptions see: Hernan, Miguel A., and James M. Robins. Causal inference what if. Boca Raton: Taylor and Francis, 2024. </p><p>For more information on the E-value test see: VanderWeele, Tyler J., and Peng Ding. &quot;Sensitivity analysis in observational research: introducing the E-value.&quot; Annals of internal medicine 167, no. 4 (2017): 268-274.</p><pre><code class="language-julia hljs">validate(g_computer)</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../its/">« Interrupted Time Series Estimation</a><a class="docs-footer-nextpage" href="../doublemachinelearning/">Double Machine Learning »</a><div class="flexbox-break"></div><p class="footer-message">© 2023 Darren Colby</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.24 on <span class="colophon-date" title="Wednesday 27 December 2023 20:38">Wednesday 27 December 2023</span>. Using Julia version 1.8.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 0599e83

Please sign in to comment.