create.regr.data: A function for creating random regression data.

View source: R/sample-data.R

create.regr.dataR Documentation

A function for creating random regression data.

Description

This function creates a random data.frame with n observations of p parameters. You can choose whether or not the response variable y is binary or continuous. It returns a list with the data.frame as well as a vector of the true beta values used to create the data.

Usage

create.regr.data(n, p, ytype = "continuous", include.categorical = FALSE)

Arguments

n

The number of observations in the random data set.

p

The number of parameters in the random data set. The function randomly chooses how many will be binary or continuous.

ytype

Determines whether to have a binary or continuous response variable. Defaults to "continuous"

include.categorical

A boolean condition that determines whether or not to include categorical predictors. By default it is set to FALSE

Examples

create.regr.data(100,4,ytype="continuous")
create.regr.data(100,4,ytype="binary")

snelson89/extendedglmnetGroup7 documentation built on May 12, 2022, 7:38 p.m.