Visualize weights and variables over time

plot_ccw_over_time(df)

Arguments

df

A data.frame with one row per clone per observation period that contains weights for each patient-period as returned by generate_ccw()

Value

a ggplot2 object

Examples


# Load the toy dataset
data(toy_df)

# Create clones
clones <- create_clones(toy_df, 
                        id = "id", 
                        event = "death", 
                        time_to_event = "fup_obs", 
                        exposure = "surgery", 
                        time_to_exposure = "timetosurgery", 
                        ced_window = 365.25/2)

clones_long <- cast_clones_to_long(clones)
clones_long_w <- generate_ccw(clones_long, predvars = c("age"))
plot_ccw_over_time(clones_long_w)