Skip to content

Commit 113e6a0

Browse files
committed
fix: define rigour_effect_on_reproducibility before use.
1 parent 2c8f91d commit 113e6a0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

causal_intro/article/intro-causality.qmd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -456,12 +456,6 @@ We can estimate the total causal effect of *Rigour* on *Reproducibility* simply
456456

457457
$$\text{Reproducibility} \sim \text{Rigour}$$
458458

459-
Since we simulated the data, we can calculate the "true" causal effect, which in this case is `r round(rigour_effect_on_reproducibility, 2)` (see [Appendix -@sec-appendix-rigour-on-reproducibility] for details).
460-
We can hence validate our regression approach and see if it is capable of correctly inferring the true causal effect.
461-
@fig-rigour-on-reproducibility shows that the regression approach is capable of retrieving the correct result.
462-
We deliberately chose a moderate sample size of `r nrow(df)` for our simulation.
463-
Point estimates derived from the simulated data thus only approximate the theoretical values.
464-
465459
```{r}
466460
# compute the theoretical effect of rigour on reproducibility
467461
field1 <- function(x) x * plogis(get_coefs("intercept", "open_data") + get_coefs("rigour", "open_data") * x + get_coefs("field", "open_data")[[1]]) * dnorm(x)
@@ -473,6 +467,12 @@ m_rigour_reprod <- lm(reproducibility ~ rigour, data = df)
473467
# summary(m_rigour_reprod)
474468
```
475469

470+
Since we simulated the data, we can calculate the "true" causal effect, which in this case is `r round(rigour_effect_on_reproducibility, 2)` (see [Appendix -@sec-appendix-rigour-on-reproducibility] for details).
471+
We can hence validate our regression approach and see if it is capable of correctly inferring the true causal effect.
472+
@fig-rigour-on-reproducibility shows that the regression approach is capable of retrieving the correct result.
473+
We deliberately chose a moderate sample size of `r nrow(df)` for our simulation.
474+
Point estimates derived from the simulated data thus only approximate the theoretical values.
475+
476476
```{r rigour-on-reproducibility, fig.height=2.5, fig.width=4.5}
477477
#| label: fig-rigour-on-reproducibility
478478
#| fig-cap: "Effect of *Rigour* on *Reproducibility*, estimated with a simple linear regression."

0 commit comments

Comments
 (0)