View source: R/construct_outcome.R

construct_outcome | R Documentation |

This function constructs the output given the relaxsolution to the associated network flow problem and the original dataset.

```
construct_outcome(res, dist_list_1, Z, dataset, controls = 1)
```

`res` |
A callrelax output. |

`dist_list_1` |
A possibly sparse representation of the first distance matrix. |

`Z` |
A vector of treatment status. |

`dataset` |
The original dataset. |

`controls` |
Number of controls matched to each treated. |

This function returns a list of three objects: 1) feasible: 0/1 depending on the feasibility of the matching problem; 2) data_with_matched_set_ind: a data frame that is the same as the original data frame, except that a column called “matched_set” and a column called “distance” are appended to it. “matched_set” column assigns 1,2,...,n_t to each matched set, and NA to those not matched to any treated. Variable “distance” records the distance (as specified in the left network) between each matched control and the treated, and assigns NA to all treated and controls that are left unmatched. If matching is not feasible, NULL will be returned; 3) matched_data_in_order:a dataframe organized in the order of matched sets and otherwise the same as data_with_matched_set_ind. Note that the matched_set column assigns 1,2,...,n_t for as indices for matched sets, and NA for those controls that are not paired. Null will be returned if the matching is unfeasible.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.