Skip to content

Commit

Permalink
documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhuling committed May 6, 2022
1 parent 491cdfb commit 6466315
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 0 deletions.
18 changes: 18 additions & 0 deletions R/independence_weights_estimation.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@
#'
#' Huling, J. D., Greifer, N., & Chen, G. (2021). Independence weights for causal inference with continuous exposures.
#' arXiv preprint arXiv:2107.07086. \url{https://arxiv.org/abs/2107.07086}
#' @return An object of class \code{"independence_weights"}.
#' \item{weights}{the estimated weights, the distance covariance optimal weights (DCOWs)}
#' \item{A}{the treatment vector}
#' \item{opt}{the object returned by whatever optimization routine was used}
#' \item{objective}{the value of the optimized objective function}
#' \item{distcov_unweighted}{the unweighted distance covariance between treatment and covariates}
#' \item{distcov_weighted}{the weighted distance covariance between treatment and covariates}
#' \item{energy_A}{the (energy) distance between the treatment distribution and the weighted treatment distribution. Smaller values mean the marginal distribution of the treatment is preserved after weighting}
#' \item{energy_x}{the (energy) distance between the covariate distribution and the weighted covariate distribution. Smaller values mean the marginal distribution of the covariates is preserved after weighting}
#' \item{ess}{the expected sample size after weighting. Kish's approximation is used}
#'
#' @examples
#'
Expand Down Expand Up @@ -290,6 +300,14 @@ independence_weights <- function(A,
#'
#' Huling, J. D., Greifer, N., & Chen, G. (2021). Independence weights for causal inference with continuous exposures.
#' arXiv preprint arXiv:2107.07086. \url{https://arxiv.org/abs/2107.07086}
#' @return An object of class \code{"weighted_energy_terms"}.
#' \item{D_w}{the value of the DCOW measure}
#' \item{distcov_unweighted}{the unweighted distance covariance between treatment and covariates}
#' \item{distcov_weighted}{the weighted distance covariance between treatment and covariates}
#' \item{energy_A}{the (energy) distance between the treatment distribution and the weighted treatment distribution. Smaller values mean the marginal distribution of the treatment is preserved after weighting}
#' \item{energy_x}{the (energy) distance between the covariate distribution and the weighted covariate distribution. Smaller values mean the marginal distribution of the covariates is preserved after weighting}
#' \item{ess}{the expected sample size after weighting. Kish's approximation is used}
#'
#' @examples
#'
#' simdat <- simulate_confounded_data(seed = 999, nobs = 100)
Expand Down
2 changes: 2 additions & 0 deletions R/print_indep_weights_object.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#' @rdname print
#' @seealso \code{\link[independenceWeights]{independence_weights}} for function which produces energy balancing weights
#' @importFrom stats quantile
#' @return Nothing returned
#' @export
print.independence_weights <- function(x, digits = max(getOption('digits')-3, 3), ...)
{
Expand All @@ -35,6 +36,7 @@ print.independence_weights <- function(x, digits = max(getOption('digits')-3, 3)
#' @rdname print
#' @seealso \code{\link[independenceWeights]{weighted_energy_stats}} for function which produces energy balancing weights
#' @importFrom stats quantile
#' @return Nothing returned
#' @export
print.weighted_energy_terms <- function(x, digits = max(getOption('digits')-3, 3), ...)
{
Expand Down
4 changes: 4 additions & 0 deletions R/simulate_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
#' Nonparametric estimation of population average dose-response curves using entropy balancing weights for continuous exposures.
#' Health Services and Outcomes Research Methodology, 21(1), 69-110.
#' @importFrom stats dist rbinom rchisq rnorm
#' @return A list with the following elements
#' \item{data}{a \code{data.frame} with the response (\code{Y}), treatment (\code{A}), confounders (\code{Z1} to \code{Z5}), and true average dose response function \code{truth}}
#' \item{true_adrf}{a function; true average dose response function}
#' \item{original_covariates}{original, untransformed covariates in the simulation setup. Do not use, as it makes the simulation setup significantly easier.}
#'
#' @examples
#'
Expand Down
11 changes: 11 additions & 0 deletions man/independence_weights.Rd

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

5 changes: 5 additions & 0 deletions man/print.Rd

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

5 changes: 5 additions & 0 deletions man/simulate_confounded_data.Rd

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

8 changes: 8 additions & 0 deletions man/weighted_energy_stats.Rd

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

0 comments on commit 6466315

Please sign in to comment.