gendat_logreg: Generate Data Based on the Logistic Regression Model.

Description Usage Arguments Details Value Author(s) Examples

View source: R/gendat.R

Description

Generates data based on the logistic regression model using the inverse logit link function.

Usage

1
gendat_logreg(n, beta, rFUN_X = rnorm, ...)

Arguments

n

Sample size.

beta

k \times 1 vector of k regression parameters.

rFUN_X

The distribution function used to generate values of \mathbf{X}. The default value is rnorm for the Gaussian probability density function.

...

Arguments to pass to rFUN_X.

Details

Randomly generates the data matrix \mathbf{X} and the regressand data \mathbf{y}. \mathbf{y}_{n \times 1} is generated from a binomial distribution where p ≤ft( x \right) is equal to \frac{ 1 } { 1 - e^{- ≤ft( \mathbf{X}_{n \times k} \boldsymbol{β}_{n \times 1} \right)} } .

Value

Returns a list with two elements X and y.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

1
2
3
4
5
6
7
data <- gendat_logreg(
  n = 100,
  beta = c(.5, .5, .5),
  rFUN_X = rnorm,
  mean = 0,
  sd = 1
)

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