generate_dummy_data {deltatest}R Documentation

Generate Dummy Data

Description

Generate random dummy data for simulation studies. For details, see Section 4.3 in Deng et al. (2017).

Usage

generate_dummy_data(
  n_user,
  model = c("Bernoulli", "normal"),
  xi = 0,
  sigma = 0,
  random_unit = c("user", "session", "pageview"),
  treatment_ratio = 0.5
)

Arguments

n_user

integer value specifying the number of users included in the generated data. Since multiple rows are generated for each user, the number of rows in the data exceeds the number of users.

model

character string specifying the model that generates the potential outcomes. It must be one of "Bernoulli" (default) or "normal". You can specify just the initial letter.

xi

numeric value specifying the treatment effect variation (TEV) under the Bernoulli model, where TEV = 2\xi. This argument is ignored if the model argument is set to "normal". The default is 0.

sigma

numeric value specifying the treatment effect variation (TEV) under the normal model, where TEV = \sigma. This argument is ignored if the model argument is set to "Bernoulli". The default is 0.

random_unit

character string specifying the randomization unit. It must be one of "user" (default), "session", or "pageview". You can specify just the initial letter. The default is 0.

treatment_ratio

numeric value specifying the ratio assigned to treatment. The default value is 0.5.

Value

data.frame with the columns user_id, group, and metric, where each row represents a metric value for a page-view.

References

Examples

library(deltatest)

set.seed(314)
generate_dummy_data(n_user = 2000)


[Package deltatest version 0.1.0 Index]