Kuan-Liu-Lab / causens

An R package for causal sensitivity analysis methods
https://kuan-liu-lab.github.io/causens/
MIT License
1 stars 0 forks source link

Add `summary` function #53

Open larryshamalama opened 3 days ago

larryshamalama commented 3 days ago

Here is a sketch of what and how the existing code would have to be modified

causens <- function(...) {
  ...
  result <- list(estimated_ate = estimated_ate)
  class(result) <- "causens"

  return(result)
}

The following works via S3 dispatch

summary.causens <- function(causens_object, ...) {
  cat("Summary of Causal Effect Analysis\n")
  cat("=================================\n")
  cat(sprintf("Estimated Average Treatment Effect (ATE): %f\n", causens_object$estimated_ate))

  invisible(object)
}
larryshamalama commented 3 days ago

Probably good to also do this with plot