Skip to content

Commit

Permalink
Cleaning/updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ngreifer committed Oct 3, 2024
1 parent 674ffb0 commit aafd468
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion R/weightit2optweight.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Optimization-Based Weighting
#' @name method_optweight
#' @aliases method_optweight method_sbw
#' @aliases method_optweight
#' @usage NULL
#'
#' @description
Expand Down
1 change: 0 additions & 1 deletion man/method_optweight.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions vignettes/estimating-effects.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ avg_comparisons(fit,
transform = "exp")
```

The output displays the marginal RR, its Z-value, the p-value for the Z-test of the log RR against 0, and its confidence interval. (Note that even though the `Contrast` label still suggests the log RR, the RR is actually displayed.) To view the log RR and its standard error, omit the `transform` argument.
The output displays the marginal RR, its Z-value, the p-value for the Z-test of the log RR against 0, and its confidence interval. (Note that even though the `Comparison` label still suggests the log RR, the RR is actually displayed.) To view the log RR and its standard error, omit the `transform` argument.

For the marginal OR, the only thing that needs to change is that `comparison` should be set to `"lnoravg"`.

Expand Down Expand Up @@ -450,15 +450,15 @@ p <- avg_predictions(fit,

Although one can examine the expected potential outcomes, it is often more useful to see them plotted. We can generate a plot of the ADRF and its pointwise confidence band using `ggplot2`[^4]:

[^4]: You can also use `plot_predictions()`, though after requesting the predictions in the prior step it is quicker to use `ggplot()`.
[^4]: You can also use `marginaleffects::plot_predictions()`, though after requesting the predictions in the prior step it is quicker to use `ggplot()`.

```{r, eval = me_ok, fig.height=3.5, fig.width=7}
library("ggplot2")
ggplot(p, aes(x = Ac)) +
geom_line(aes(y = estimate)) +
geom_ribbon(aes(ymin = conf.low, ymax = conf.high),
alpha = .3) +
labs(x = "Ac", y = "E[Y|A]") +
labs(x = "Ac", y = "E[Y|Ac]") +
theme_bw()
```

Expand All @@ -483,7 +483,7 @@ ggplot(s, aes(x = Ac)) +
geom_ribbon(aes(ymin = conf.low, ymax = conf.high),
alpha = .3) +
geom_hline(yintercept = 0, linetype = "dashed") +
labs(x = "Ac", y = "dE[Y|A]/dA") +
labs(x = "Ac", y = "dE[Y|Ac]/dAc") +
theme_bw()
```

Expand Down

0 comments on commit aafd468

Please sign in to comment.