# Simulation der SBD Daten # # ======================== # set.seed(123) Ji <- rep(6, 30) n <- sum(Ji) I <- length(Ji) ID <- rep(1:I, Ji) gender <- 1 * (ID > 15) dosis <- rep(c(10, 20, 40, 80, 120, 160), I) RI <- rnorm(I, 10) RS <- rnorm(I, sd = 0.09) eps <- rnorm(n, sd = 2) fun <- function(x){ -2 * sqrt(x) - x/20 } SBD <- 150 + fun(dosis) - 2 * gender - dosis * gender/100 + RI[ID] + RS[ID] * dosis + eps blutdruck <- data.frame(ID = ID, gender = gender, dosis = dosis, SBD = SBD)