Estimate the parameters (including standard errors) across the cells in the sample.

est_cell_stats(
  y,
  X,
  d = NULL,
  partition = NULL,
  cell_factor = NULL,
  estimator_var = NULL,
  est_plan = NULL,
  alpha = 0.05
)

Arguments

y

Nx1 matrix of outcome (label/target) data. With multiple core estimates see Details below.

X

NxK matrix of features (covariates). With multiple core estimates see Details below.

d

(Optional) NxP matrix (with colnames) of treatment data. If all equally important they should be normalized to have the same variance. With multiple core estimates see Details below.

partition

(Optional, need this or cell_factor) partitioning returned from fit_estimate_partition

cell_factor

(Optional, need this or partition)

estimator_var

(Optional) a function with signature list(param_est, var_est) = function(y, d) (where if no d then can pass in null). If NULL then will choose between built-in mean-estimator and scalar_te_estimator

est_plan

Estimator plan

alpha

Significance threshold

Value

list

cell_factor

Factor with levels for each cell for X. Length N.

stats

data.frame(cell_i, N_est, param_ests, var_ests, tstats, pval, ci_u, ci_l, p_fwer, p_fdr)

Multiple estimates

With multiple core estimates (M) there are 3 options (the first two have the same sample across treatment effects).

  1. DS.MULTI_SAMPLE: Multiple pairs of (Y_m,W_m). y,X,d are then lists of length M. Each element then has the typical size The N_m may differ across m. The number of columns of X will be the same across m.

  2. DS.MULTI_D: Multiple treatments and a single outcome. d is then a NxM matrix.

  3. DS.MULTI_Y: A single treatment and multiple outcomes. y is then a NXM matrix.