Skip to contents

Simulate data to test logistic regression.

Usage

simulatePredictionData(
  mean1 = -0.1,
  n1 = 100,
  mean2 = -mean1,
  n2 = n1,
  mean_unknown = (mean1 + mean2)/2,
  n_unknown = round(n1/2),
  ratio_unknown = 0.5,
  sd = 0.2,
  group_labels = c("A", "B", "NA")
)

Arguments

mean1

the mean of group 1.

n1

the size of group 1.

mean2

the mean of group 2.

n2

the size of group 2.

mean_unknown

the mean of the group with a random outcome.

n_unknown

the size of the group with a random outcome.

ratio_unknown

the probability of outcome 1 occurring in the random group.

sd

the standard deviation for each group (i.e. parameter passed to rnorm). Variance is assumed to be equal across all groups.

group_labels

the labels for the groups in the data.frame.

Value

a data.frame with n1 + n2 + n_unknown rows and 3 variables (Group, X, and Y).