powered by
Simulates data for single or multiple regression.
simulate_data_regression(coefs = 0.5, sample = 100, error = 0)
Desired theorethical coefs. Can be a single value or a list.
Desired sample size.
The error (standard deviation of gaussian noise).
See https://stats.stackexchange.com/questions/59062/multiple-linear-regression-simulation
# NOT RUN { library(psycho) data <- simulate_data_regression(coefs = c(0.1, 0.8), sample = 50, error = 0) fit <- lm(y ~ ., data = data) coef(fit) analyze(fit) # }
Run the code above in your browser using DataLab