cleverly.longitudinal.LongitudinalData.to_long_panel#

LongitudinalData.to_long_panel() → Any[source]#

Return the long panel this container holds: one row per unit and node.

A unit has a row at each node at which it is still in the study: uncensored and event-free before the node. Rows are sorted by unit and then time, in the backend the data came from. The outcome is repeated on every row of a unit, and missing for a censored unit. An event column holds 1 on the event row, 0 before it, and a missing value on the row where the unit was censored.

Three values differ from the input: the weights are normalized to mean one, a covariate screened out at a node is missing at that node, and known probability columns are not returned.

Returns:
DataFrame

The long panel, with the column names of panel.

Raises:
DataError

If the container was not built by from_long_panel().