gendat_linreg_y: Generate Regressand Data (y) From a Linear Regression Model.

Description Usage Arguments Details Author(s) See Also Examples

View source: R/gendat.R

Description

Generates regressand data from a k-variable linear regression model.

Usage

1
gendat_linreg_y(X, beta, rFUN_y = rnorm, ...)

Arguments

X

The data matrix, that is an n \times k matrix of n observations of k regressors, which includes a regressor whose value is 1 for each observation. Also called the design matrix and model matrix.

beta

k \times 1 vector of k regression parameters.

rFUN_y

The distribution function used to generate values of the residuals ε. The default value is rnorm for the Gaussian probability density function.

...

Arguments to pass to rFUN_y.

Details

Randomly generates the regressand data (\mathbf{y}) using specified population parameters defined by \mathbf{y}_{n \times 1} = \mathbf{X}_{n \times k} \boldsymbol{β}_{k \times 1} + \boldsymbol{ε}_{n \times 1} . The distribution of ε is supplied by the argument rFUN_y (rnorm is the default value). Additional arguments to rFUN_y are supplied using the ... argument. By default, ε is assumed to be normally distributed with a mean of 0 and a variance of 1 ( \mathcal{N} \sim ≤ft( μ_{ε} = 0, σ_{ε}^{2} = 1 \right) ).

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

Other data generating functions: gendat_linreg_X(), gendat_linreg(), gendat_mvn_a(), gendat_mvn_fe(), gendat_mvn(), gendat_vm(), gendat()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
X <- gendat_linreg_X(
  n = 100,
  k = 3,
  constant = TRUE,
  rFUN_X = rnorm,
  mean = 0,
  sd = 1
)
y <- gendat_linreg_y(
  X = X,
  beta = c(.5, .5, .5),
  rFUN_y = rnorm,
  mean = 0,
  sd = 1
)

jeksterslabds/jeksterslabRds documentation built on July 16, 2020, 3:41 p.m.