plte_plot {pltesim} | R Documentation |
Plot objects created by plte_builder
Description
Plot objects created by plte_builder
Usage
plte_plot(obj, t_labels = TRUE)
Arguments
obj |
a |
t_labels |
logical whether or not to include time labels for each point. |
Value
A gg
ggplot2 object that can be modified using the
+
in combination with other ggplot2 functions.
Examples
data('negative')
# BTSCS set the data
neg_set <- btscs(df = negative, event = 'y', t_var = 'tim',
cs_unit = 'group', pad_ts = FALSE)
# Create temporal dependence variables
neg_set$t <- neg_set$spell + 1
m1 <- glm(y ~ x + t + I(t^2) + I(t^3),
family = binomial(link = 'logit'),
data = neg_set)
counterfactual <- data.frame(x = 0.5)
sim1 <- plte_builder(obj = m1, obj_tvar = 't',
cf = counterfactual, t_points = c(13, 25),
cf_duration = 4, ci = 99)
# With time point labels
plte_plot(sim1)
# Without time point labels
plte_plot(sim1, t_labels = FALSE)
[Package pltesim version 1.0 Index]