SampleData: Generates synthetic data from Gaussian distributions

Description Usage Arguments Value Examples

Description

Generates synthetic data from Gaussian distributions

Usage

1
2
3
SampleData(n.metrics = 100, n.observations = 20, mu.pre = 100,
  sigma.pre = 1, rho.ctrl = 0.8, rho.trmt = NULL, mu.ctrl = NULL,
  sigma.ctrl = NULL, mu.trmt = NULL, sigma.trmt = NULL, spread = FALSE)

Arguments

n.metrics

Number of metrics.

n.observations

Number of observations.

mu.pre

Vector or scalar representing the mean during the pre-period for each metric.

sigma.pre

Vector or scalar representing the standard deviation during the pre-period for each metric.

rho.ctrl

Vector or scalar representing the correlation between the pre-period and the post-period for the control group for each metric.

rho.trmt

Vector or scalar representing the correlation between the pre-period and the post-period for the treatment group for each metric. If missing, set equal to rho.ctrl.

mu.ctrl

Vector or scalar representing the mean during the post-period for the control group for each metric. If missing, set equal to mu.pre.

sigma.ctrl

Vector or scalar representing the standard deviation during the post-period for the control group for each metric. If missing, set equal to sigma.pre.

mu.trmt

Vector or scalar representing the mean during the post-period for the treatment group for each metric. If missing, set equal to mu.pre.

sigma.trmt

Vector or scalar representing the standard deviation during the post-period for the treatment group for each metric. If missing, set equal to sigma.pre.

spread

If TRUE, the output has a horizontal structure with a pre.post column and column for each metric. If FALSE, the output has a vertical structure with a metric column, a pre column and a post column.

Value

A data.frame which can be used as input for the PrePost and the PreCheck functions.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
  data <- SampleData(n.metrics = 10)
  ans <- PrePost(data)

  n.metrics <- 10
  mu.pre <- 100
  mu.ctrl <- 100
  mu.trmt <- c(110, rep(100, n.metrics - 1))
  data <- SampleData(n.metrics = n.metrics,
                     mu.pre = mu.pre,
                     mu.ctrl = mu.ctrl,
                     mu.trmt = mu.trmt)
  ans <- PrePost(data)

  data <- SampleData(n.metrics = n.metrics,
                     mu.pre = mu.pre,
                     mu.ctrl = mu.ctrl,
                     mu.trmt = mu.trmt,
                     spread = TRUE)
  std.data <- ReshapeData(data)
  ans <- PrePost(std.data)

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