A function that returns averaged weighted surfaces (both IPW and Hajek) along with weights
get_weighted_surf(
obs_dens,
cf_dens,
mediation = FALSE,
cate = FALSE,
obs_med_log_sum_dens,
cf_med_log_sum_dens,
treatment_data,
smoothed_outcome,
lag,
entire_window,
time_after,
truncation_level = truncation_level
)
list of an average weighted surface (`avarage_surf`, an `im` object), a Hajek average weighted surface (`average_weighted_surf_haj`, an `im` object), weights, and smoothed outcomes
observed density
counterfactual density
whether to perform causal mediation analysis. By default, FALSE.
whether to perform the heterogeneity analysis. By default, FALSE.
sum of log densities of mediators for the observed (if `mediation = TRUE`)
sum of log densities of mediators for counterfactual (if `mediation = TRUE`)
column of a hyperframe that summarizes treatment data. In the form of `hyperframe$column`.
column of a hyperframe that summarizes the smoothed outcome data
integer that specifies lags to calculate causal estimates
owin object (the entire region of interest)
whether to include one unit time difference between treatment and outcome
the level at which the weights are truncated (see `get_estimates()`)
`get_weighted_surf()` is an internal function to `get_estimates()` function. If `time_after` is TRUE, then this function uses treatment data and weights from lag to nrow(data)-1, and outcome data from lag+1 to nrow(data).