Description Usage Arguments Details Value Author(s) See Also Examples
Generates random data matrix from a k-variable linear regression model.
1 | gendat_linreg_X(n, k, constant = TRUE, rFUN_X = rnorm, ...)
|
n |
Sample size. |
k |
Number of regressors. |
constant |
Logical.
An option to include or to exclude the vector of constants.
If |
rFUN_X |
The distribution function
used to generate values of \mathbf{X}.
The default value is |
... |
Arguments to pass to |
Randomly generates the data matrix
(\mathbf{X}),
that is an
n \times k
dimensional matrix of
n
observations of
k
regressors,
which includes a regressor whose value is 1 for each observation.
The data generating function is supplied by the argument
rFUN_X
(rnorm
is the default value).
Additional arguments to rFUN_X
are supplied using the
...
argument.
The data matix is also called the design matrix and model matrix.
If constant = TRUE
,
returns an n \times k numeric matrix
where the first column consists of 1s.
If constant = FALSE
,
returns an n \times k - 1 numeric matrix.
Ivan Jacob Agaloos Pesigan
Other data generating functions:
gendat_linreg_y()
,
gendat_linreg()
,
gendat_mvn_a()
,
gendat_mvn_fe()
,
gendat_mvn()
,
gendat_vm()
,
gendat()
1 2 3 4 5 6 7 8 | X <- gendat_linreg_X(
n = 100,
k = 3,
constant = TRUE,
rFUN_X = rnorm,
mean = 100,
sd = 15
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.