cleverly.longitudinal.PanelLayout#

class cleverly.longitudinal.PanelLayout(unit: str, time: str, decision_times: tuple[~typing.Any, ...], treatment: tuple[str, ...], baseline: tuple[str, ...], time_varying: tuple[str, ...] = (), censoring: str | None = None, outcome: str | None = None, event: tuple[str, ...] = (), causes: tuple[str, ...] = (), cluster: str | None = None, cluster_labels: tuple[~typing.Any, ...] = (), weights: str | None = None, omitted: tuple[tuple[str, int], ...] = <factory>, treatment_probabilities: tuple[tuple[~typing.Any, str], ...] | None = None, censoring_probabilities: str | None = None)[source]#

The long-panel roles a container was built from.

from_long_panel() records it, and to_long_panel() reads it.

Parameters:
unitstr

The unit identifier column.

timestr

The decision-time column.

decision_timestuple

The decision-time labels, in node order. Node t is decision_times[t - 1].

treatmenttuple of str

The treatment column, or the components of a vector treatment.

baselinetuple of str

The unit-level covariates.

time_varyingtuple of str

The covariates measured at each row before its decision.

censoringstr or None

The observation indicator column.

outcomestr or None

The end-of-study outcome column.

eventtuple of str

The event indicator columns of a survival outcome, one per cause.

causestuple of str

The cause labels of competing risks, else empty.

clusterstr or None

The cluster identifier column.

cluster_labelstuple

The cluster identifiers in the order that the container’s cluster codes index.

weightsstr or None

The unit-level weight column.

omittedtuple of tuple of (str, int)

Each time-varying column and node that the leading run of missing values left out.

treatment_probabilitiestuple of tuple or None

The (level, column) pairs of a known treatment mechanism.

censoring_probabilitiesstr or None

The column of the known retention probabilities.

Methods#

PanelLayout.describe() → str[source]#

Return the settings line of a fit on an adapted panel.

Returns:
str

The unit and time columns and the decision-time labels.

Attributes#

PanelLayout.causes: tuple[str, ...] = ()#
PanelLayout.censoring: str | None = None#
PanelLayout.censoring_probabilities: str | None = None#
PanelLayout.cluster: str | None = None#
PanelLayout.cluster_labels: tuple[Any, ...] = ()#
PanelLayout.event: tuple[str, ...] = ()#
PanelLayout.outcome: str | None = None#
PanelLayout.time_varying: tuple[str, ...] = ()#
PanelLayout.treatment_probabilities: tuple[tuple[Any, str], ...] | None = None#
PanelLayout.weights: str | None = None#
PanelLayout.unit: str#
PanelLayout.time: str#
PanelLayout.decision_times: tuple[Any, ...]#
PanelLayout.treatment: tuple[str, ...]#
PanelLayout.baseline: tuple[str, ...]#
PanelLayout.omitted: tuple[tuple[str, int], ...]#