mdd_group_means: Compute group means by time period

View source: R/mdd_group_means.R

mdd_group_meansR Documentation

Compute group means by time period

Description

Compute the means of each group for each time periods

Usage

mdd_group_means(
  mdd_dat,
  conf.int = FALSE,
  weights = NULL,
  by_treat_period = FALSE
)

Arguments

mdd_dat

An object of class mdd_dat created by mdd_data_format

conf.int

Weather to compute confidence intervals for the means

weights

Optional column name of weights variable

by_treat_period

Should the mean be computed by treated period, i.e. before/after? Default to FALSE, so computes for every instance of time.index.

Examples

 library(multiDiff)
 dat_DiD_raw <- sim_dat_common()

 ## format data
 dat_DiD <- mdd_data_format(data=dat_DiD_raw)

 mdd_group_means(dat_DiD)
 mdd_group_means(dat_DiD, conf.int = TRUE)

MatthieuStigler/multiDiff documentation built on Oct. 21, 2023, 8:13 a.m.