ReshapeData: Reshape data to have the structure required by 'PrePost' and...

Description Usage Arguments Value Examples

Description

Reshape data to have the structure required by PrePost and PreCheck

Usage

1
2
3
4
ReshapeData(data, condition.col = "condition",
  observation.col = "observation", pre.post.col = "pre.post",
  condition.levels = c("control", "treatment"), pre.post.levels = c("pre",
  "post"))

Arguments

data

A data.frame with several variables. The variable condition indicates the treatment assignment (control or treatment) for each row. The variable observation indicates the observation number of each row. The variable pre.post indicates the period (pre or post) for each row. The remaining variables represent the metrics to be tested. If there are multiple rows for a given combination of condition, observation and pre.post, these rows are summed up.

condition.col

The name of the variable indicating the treatment assignment for each row in data.

observation.col

The name of the variable indicating the observation for each row in data.

pre.post.col

The name of the variable indicating the period for each row in data.

condition.levels

The names indicating control and treatment in data.

pre.post.levels

The names indicating pre and post period in data.

Value

A data.frame with several variables. The variable condition indicates the treatment assignment (control or treatment) for each row. The variable pre indicates the observed value during the pre-period for each row. The variable metric indicates the name of each metric.

Examples

1
2
3
  data <- SampleData(n.metrics = 4, spread = TRUE)
  reshaped.data <- ReshapeData(data)
  ans <- PrePost(reshaped.data)

google/abpackage documentation built on May 8, 2019, 11:44 a.m.