datgen: datgen : Function to generate data

Description Usage Arguments Value Author(s) Examples

View source: R/datgen.R

Description

This is used to generate a data from a logit model. The out come is a binary which represents the whether the event is observed or not. The treatment arm, biomarker value are the main exposure variables.

Usage

1
datgen(m, n, coeff, dpar)

Arguments

m

The number of data sets to generate

n

The sample size of each data set

dpar

The parameter of the biomarker distribution

coff

The initial coefficients of the model to generate data

Value

A list with m data set each with n sample size

Author(s)

Henok Woldu

Examples

1
2
3
4
  # Lets say we want to generat m =100 data set each with n= 500 sample size
  # Further lets assume the biomarker is normally distributed with mean 0 and var = 1
  # If the var of the error is given to be 0.1, then
  mydat <- datgen(100,500,c(0,1,0.1))

henok535/RMPB documentation built on May 17, 2019, 11:08 a.m.