# Generate example data
language_test <- data.frame(
Before = rnorm(100, mean = 50, sd = 10),
After = rnorm(100, mean = 55, sd = 10)
)
# Replicate data
replicate_data <- function(start, end, Before, After, data) {
mu <- seq(start * 100, end * 100, by = (end - start))
mu <- rep(mu, each = nrow(data))
before <- data[[Before]] - mu / 100
after <- data[[After]]
mee_chua <- data.frame(mu = mu, before = before, after = after)
return(mee_chua)
}
mee_chua <- replicate_data(0, 1, "Before", "After", data = language_test)
mee_chua <- mee_chua[order(mee_chua$mu), ] # Sortieren nach 'mu'
# Regression ausführen und Ergebnisse erhalten
reg_results <- meechua_reg(mee_chua)
# Zugriff auf Ergebnisse
mod_coef <- reg_results$mod_coef
se_after <- reg_results$se_after
# Anzeigen der Ergebnisse
print(mod_coef)
print(se_after)
Run the code above in your browser using DataLab