data_gen_lm {stressor} | R Documentation |
Data Generation for Linear Regression
Description
Creates a synthetic data set for an additive linear model. See details for clarification.
Usage
data_gen_lm(n, weight_vec = rep(1, 5), y_int = 0, resp_sd = 1, ...)
Arguments
n |
The number of observations for each parameter. |
weight_vec |
The parameter coefficients where each entry represents the coefficients for the additive linear model. |
y_int |
The y-intercept term of the additive model. |
resp_sd |
The standard deviation of the epsilon term to be added for noise. |
... |
Additional arguments that are not currently implemented. |
Details
Observations are generated from the following model:
y = \sum_{i = 1}^n \alpha_i\cdot x_i + y_{int}
Where 'n' is the number of parameters to be used and the \alpha_i
's
are the weights associated with each x_i
. With the y_{int}
being where it crosses the y-axis.
Value
A data.frame object with the n rows and the response variable with the number of parameters being equal to the number of columns from the weight matrix.
Examples
# Generates 10 observations
lm_data <- data_gen_lm(10)
lm_data