econml.inference.PopulationSummaryResults

class econml.inference.PopulationSummaryResults(pred, pred_stderr, mean_pred_stderr, d_t, d_y, alpha, value, decimals, tol, output_names=None, treatment_names=None)[source]

Bases: object

Population summary results class for inferences.

Parameters
  • d_t (int or None) – Number of treatments

  • d_y (int) – Number of outputs

  • pred (array-like, shape (m, d_y, d_t) or (m, d_y)) – The prediction of the metric for each sample X[i]. Note that when Y or T is a vector rather than a 2-dimensional array, the corresponding singleton dimensions should be collapsed (e.g. if both are vectors, then the input of this argument will also be a vector)

  • pred_stderr (array-like, shape (m, d_y, d_t) or (m, d_y)) – The prediction standard error of the metric for each sample X[i]. Note that when Y or T is a vector rather than a 2-dimensional array, the corresponding singleton dimensions should be collapsed (e.g. if both are vectors, then the input of this argument will also be a vector)

  • mean_pred_stderr (None or array-like or scaler, shape (d_y, d_t) or (d_y,)) – The standard error of the mean point estimate, this is derived from coefficient stderr when final stage is linear model, otherwise it’s None. This is the exact standard error of the mean, which is not conservative.

  • alpha (optional float in [0, 1] (default=0.1)) – The overall level of confidence of the reported interval. The alpha/2, 1-alpha/2 confidence interval is reported.

  • value (optinal float (default=0)) – The mean value of the metric you’d like to test under null hypothesis.

  • decimals (optinal int (default=3)) – Number of decimal places to round each column to.

  • tol (optinal float (default=0.001)) – The stopping criterion. The iterations will stop when the outcome is less than tol

  • output_names (optional list of strings or None (default is None)) – The names of the outputs

  • treatment_names (optional list of strings or None (default is None)) – The names of the treatments

__init__(pred, pred_stderr, mean_pred_stderr, d_t, d_y, alpha, value, decimals, tol, output_names=None, treatment_names=None)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(pred, pred_stderr, …[, …])

Initialize self.

conf_int_mean(*[, alpha])

Get the confidence interval of the mean point estimate of each treatment on each outcome for sample X.

conf_int_point(*[, alpha, tol])

Get the confidence interval of the point estimate of each treatment on each outcome for sample X.

percentile_point(*[, alpha])

Get the confidence interval of the point estimate of each treatment on each outcome for sample X.

pvalue(*[, value])

Get the p value of the z test of each treatment on each outcome for sample X.

summary([alpha, value, decimals, tol, …])

Output the summary inferences above.

zstat(*[, value])

Get the z statistic of the mean point estimate of each treatment on each outcome for sample X.

Attributes

mean_point

Get the mean of the point estimate of each treatment on each outcome for sample X.

std_point

Get the standard deviation of the point estimate of each treatment on each outcome for sample X.

stderr_mean

Get the standard error of the mean point estimate of each treatment on each outcome for sample X.

stderr_point

Get the standard error of the point estimate of each treatment on each outcome for sample X.

conf_int_mean(*, alpha=0.1)[source]

Get the confidence interval of the mean point estimate of each treatment on each outcome for sample X.

Parameters

alpha (optional float in [0, 1] (default=.1)) – The overall level of confidence of the reported interval. The alpha/2, 1-alpha/2 confidence interval is reported.

Returns

lower, upper – The lower and the upper bounds of the confidence interval for each quantity. Note that when Y or T is a vector rather than a 2-dimensional array, the corresponding singleton dimensions in the output will be collapsed (e.g. if both are vectors, then the output of this method will also be a vector)

Return type

tuple of arrays, shape (d_y, d_t)

conf_int_point(*, alpha=0.1, tol=0.001)[source]

Get the confidence interval of the point estimate of each treatment on each outcome for sample X.

Parameters
  • alpha (optional float in [0, 1] (default=.1)) – The overall level of confidence of the reported interval. The alpha/2, 1-alpha/2 confidence interval is reported.

  • tol (optinal float(default=.001)) – The stopping criterion. The iterations will stop when the outcome is less than tol

Returns

lower, upper – The lower and the upper bounds of the confidence interval for each quantity. Note that when Y or T is a vector rather than a 2-dimensional array, the corresponding singleton dimensions in the output will be collapsed (e.g. if both are vectors, then the output of this method will also be a vector)

Return type

tuple of arrays, shape (d_y, d_t)

percentile_point(*, alpha=0.1)[source]

Get the confidence interval of the point estimate of each treatment on each outcome for sample X.

Parameters

alpha (optional float in [0, 1] (default=.1)) – The overall level of confidence of the reported interval. The alpha/2, 1-alpha/2 confidence interval is reported.

Returns

lower, upper – The lower and the upper bounds of the confidence interval for each quantity. Note that when Y or T is a vector rather than a 2-dimensional array, the corresponding singleton dimensions in the output will be collapsed (e.g. if both are vectors, then the output of this method will also be a vector)

Return type

tuple of arrays, shape (d_y, d_t)

pvalue(*, value=0)[source]

Get the p value of the z test of each treatment on each outcome for sample X.

Parameters

value (optinal float (default=0)) – The mean value of the metric you’d like to test under null hypothesis.

Returns

pvalue – The p value of the z test of each treatment on each outcome for sample X. Note that when Y or T is a vector rather than a 2-dimensional array, the corresponding singleton dimensions in the output will be collapsed (e.g. if both are vectors, then the output of this method will be a scalar)

Return type

array-like, shape (d_y, d_t)

summary(alpha=0.1, value=0, decimals=3, tol=0.001, output_names=None, treatment_names=None)[source]

Output the summary inferences above.

Parameters
  • alpha (optional float in [0, 1] (default=0.1)) – The overall level of confidence of the reported interval. The alpha/2, 1-alpha/2 confidence interval is reported.

  • value (optinal float (default=0)) – The mean value of the metric you’d like to test under null hypothesis.

  • decimals (optinal int (default=3)) – Number of decimal places to round each column to.

  • tol (optinal float (default=0.001)) – The stopping criterion. The iterations will stop when the outcome is less than tol

  • output_names (optional list of strings or None (default is None)) – The names of the outputs

  • treatment_names (optional list of strings or None (default is None)) – The names of the treatments

Returns

smry – this holds the summary tables and text, which can be printed or converted to various output formats.

Return type

Summary instance

zstat(*, value=0)[source]

Get the z statistic of the mean point estimate of each treatment on each outcome for sample X.

Parameters

value (optinal float (default=0)) – The mean value of the metric you’d like to test under null hypothesis.

Returns

zstat – The z statistic of the mean point estimate of each treatment on each outcome for sample X. Note that when Y or T is a vector rather than a 2-dimensional array, the corresponding singleton dimensions in the output will be collapsed (e.g. if both are vectors, then the output of this method will be a scalar)

Return type

array-like, shape (d_y, d_t)

property mean_point

Get the mean of the point estimate of each treatment on each outcome for sample X.

Returns

mean_point – The point estimate of each treatment on each outcome for sample X. Note that when Y or T is a vector rather than a 2-dimensional array, the corresponding singleton dimensions in the output will be collapsed (e.g. if both are vectors, then the output of this method will be a scalar)

Return type

array-like, shape (d_y, d_t)

property std_point

Get the standard deviation of the point estimate of each treatment on each outcome for sample X.

Returns

std_point – The standard deviation of the point estimate of each treatment on each outcome for sample X. Note that when Y or T is a vector rather than a 2-dimensional array, the corresponding singleton dimensions in the output will be collapsed (e.g. if both are vectors, then the output of this method will be a scalar)

Return type

array-like, shape (d_y, d_t)

property stderr_mean

Get the standard error of the mean point estimate of each treatment on each outcome for sample X. The output is a conservative upper bound.

Returns

stderr_mean – The standard error of the mean point estimate of each treatment on each outcome for sample X. Note that when Y or T is a vector rather than a 2-dimensional array, the corresponding singleton dimensions in the output will be collapsed (e.g. if both are vectors, then the output of this method will be a scalar)

Return type

array-like, shape (d_y, d_t)

property stderr_point

Get the standard error of the point estimate of each treatment on each outcome for sample X.

Returns

stderr_point – The standard error of the point estimate of each treatment on each outcome for sample X. Note that when Y or T is a vector rather than a 2-dimensional array, the corresponding singleton dimensions in the output will be collapsed (e.g. if both are vectors, then the output of this method will be a scalar)

Return type

array-like, shape (d_y, d_t)