Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
513 B
0
Indexable
Never
set.seed(10101)  # Für Reproduzierbarkeit
n_obs <- 1000

# Erzeuge die Daten
Instrument <- rbinom(n_obs, 1, 0.4)
ObservableThing <- rnorm(n_obs, 0, 1)
UnobservableThing <- rnorm(n_obs, 0, 1)
VariableOfInterest <- ifelse(ObservableThing + UnobservableThing + Instrument >= 2.3, 1, 0)
e <- rnorm(n_obs, 0, 1)
OutcomeVariable <- VariableOfInterest + UnobservableThing + e

# Erstelle den DataFrame
data <- data.frame(Instrument, ObservableThing, UnobservableThing, VariableOfInterest, OutcomeVariable)
Leave a Comment