R/print.R

Defines functions print.fdid

Documented in print.fdid

#' Print Method for FDID Objects
#'
#' @param x An object of class `fdid`.
#' @param ... Additional arguments (not used).
#'
#' @return Prints a brief overview of the `fdid` object
#' @author Rivka Lipkovitz.
#' @export
print.fdid <- function(x, ...) {
  if (!inherits(x, "fdid")) {
    stop("Object must be of class 'fdid'.")
  }

  cat("FDID Object\n")
  cat("--------------------------------------------------\n")
  cat("Method:           ", x$method, "\n")
  cat("Variance Type:    ", x$vartype, "\n")
  cat("Event Period: ", paste(x$tr_period, collapse = ", "), "\n")
  cat("Reference Period: ", paste(x$ref_period, collapse = ", "), "\n\n")

  cat("Event Period Estimate:\n")
  print(x$est$event)

  invisible(x)
}

Try the fdid package in your browser

Any scripts or data that you put into this service are public.

fdid documentation built on March 23, 2026, 5:07 p.m.