datafy: datafy

Description Usage Arguments Details Value Examples

Description

Generate a data set

Usage

1
datafy(obs, means, covmat, var.names, genmod)

Arguments

obs

Number of observations in the data set.

means

A vector of predictor means.

covmat

A covariance matrix (see example).

var.names

A string of variable names (optional).

genmod

Vector of parameter values for a logistic regression model used in the generation of binary outcomes.

Details

This function simulates a data set for use in simulations of model development, validation or updating.

Currently supports the generation of correlated continuous, normally distributed predictor variables and a binary outcome.

Value

datafy returns a dataframe with m predictors and a binary outcome

Examples

1
2
3
4
## Example 1: Generation of an untreated development set
covmat <- matrix(c(0.2,0,0,0.2), nrow=2)
d <- datafy(obs = 100, means = c(0,0), covmat = covmat,
     var.names = c("X1", "X2", "Y"), genmod = c(-1.5, 1, 1))

rpajou/predsims documentation built on May 28, 2019, 12:35 a.m.