plte_plot: Plot objects created by plte_builder

Description Usage Arguments Value Examples

Description

Plot objects created by plte_builder

Usage

1
plte_plot(obj, t_labels = TRUE)

Arguments

obj

a plte class object created by plte_builder.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)

christophergandrud/pltesim documentation built on May 13, 2019, 7:03 p.m.