mcf_main.ModifiedCausalForest.train_iv#

ModifiedCausalForest.train_iv(data_df)#

Train the IV modified causal forest on the training data.

Parameters:

data_df (DataFrame) – Training data containing the outcomes, treatment, instrument and features. The instrument must be specified by ‘var_iv_name’. IV estimation supports a binary treatment and a binary instrument. Instrument values must be 0 or 1 before conversion to integers. The input must meet the validation requirements under ‘dc_clean_data’, even when that option is False.

Returns:

results – Contains the results. This dictionary has the following structure: ‘tree_df’ : DataFrame

Processed sample used for both construction and filling of the first-stage forest, and for construction of the regular reduced-form forest.

’fill_y_df’DataFrame

Processed sample used to fill the regular reduced-form forest with outcomes. An additional reduced-form round exchanges its role with ‘tree_df’.

’common_support_probabilities_tree’: DataFrame (or None)

Estimated probabilities of each instrument value for the sample used to build the trees, before common-support trimming, plus the observation identifier and ‘on_support’ (1 if retained, 0 if excluded). None if ‘cs_type’ is 0 or ‘_int_with_output’ is False.

’common_support_probabilities_fill_y’: DataFrame (or None)

Estimated probabilities of each instrument value for the sample used to fill the trees, before common-support trimming, plus the observation identifier and ‘on_support’ (1 if retained, 0 if excluded). None if ‘cs_type’ is 0 or ‘_int_with_output’ is False.

’path_output’Path or None

Directory in which output is saved. None if _int_with_output is False.

Return type:

Dictionary.