Learn R Programming

simstudy (version 0.8.1)

Simulation of Study Data

Description

Simulates data sets in order to explore modeling techniques or better understand data generating processes. The user specifies a set of relationships between covariates, and generates data based on these specifications. The final data sets can represent data from randomized control trials, repeated measure (longitudinal) designs, and cluster randomized trials. Missingness can be generated using various mechanisms (MCAR, MAR, NMAR).

Copy Link

Version

Install

install.packages('simstudy')

Monthly Downloads

1,128

Version

0.8.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Keith Goldfeld

Last Published

July 29th, 2024

Functions in simstudy (0.8.1)

addCondition

Add a single column to existing data set based on a condition
delColumns

Delete columns from existing data set
addSynthetic

Add synthetic data to existing data set
defSurv

Add single row to survival definitions
betaGetShapes

Convert beta mean and precision parameters to two shape parameters
blockExchangeMat

Create a block correlation matrix with exchangeable structure
genCluster

Simulate clustered data
catProbs

Generate Categorical Formula
genCatFormula

Generate Categorical Formula
blockDecayMat

Create a block correlation matrix
defCondition

Add single row to definitions table of conditions that will be used to add data to an existing definitions table
genFactor

Create factor variable from an existing (non-double) variable
genFormula

Generate a linear formula
genCorData

Create correlated data
defMiss

Definitions for missing data
genCorOrdCat

Generate correlated ordinal categorical data
addCorData

Add correlated data to existing data.table
defRead

Read external csv data set definitions
defRepeatAdd

Add multiple (similar) rows to definitions table that will be used to add data to an existing data.table
genData

Calling function to simulate data
defRepeat

Add multiple (similar) rows to definitions table
defDataAdd

Add single row to definitions table that will be used to add data to an existing data.table
defReadAdd

Read external csv data set definitions for adding columns
defData

Add single row to definitions table
distributions

Distributions for Data Definitions
genCorFlex

Create multivariate (correlated) data - for general distributions
defReadCond

Read external csv data set definitions for adding columns
genCorGen

Create multivariate (correlated) data - for general distributions
gammaGetShapeRate

Convert gamma mean and dispersion parameters to shape and rate parameters
genMixFormula

Generate Mixture Formula
genCorMat

Create a correlation matrix
genOrdCat

Generate ordinal categorical data
genMarkov

Generate Markov chain
genNthEvent

Generate event data using longitudinal data, and restrict output to time until the nth event.
genDummy

Create dummy variables from a factor or integer variable
genDataDensity

Generate data from a density defined by a vector of integers
genSurv

Generate survival data
genSynthetic

Generate synthetic data
survGetParams

Get survival curve parameters
survParamPlot

Plot survival curves
updateDef

Update definition table
genMultiFac

Generate multi-factorial data
updateDefAdd

Update definition table
trtAssign

Assign treatment
trimData

Trim longitudinal data file once an event has occurred
trtObserve

Observed exposure or treatment
genSpline

Generate spline curves
iccRE

Generate variance for random effects that produce desired intra-class coefficients (ICCs) for clustered data.
genMiss

Generate missing data
simstudy-deprecated

Deprecated functions in simstudy
simstudy-package

simstudy: Simulation of Study Data
negbinomGetSizeProb

Convert negative binomial mean and dispersion parameters to size and prob parameters
mergeData

Merge two data tables
genObs

Create an observed data set that includes missing data
viewBasis

Plot basis spline functions
logisticCoefs

Determine intercept, treatment/exposure and covariate coefficients that can be used for binary data generation with a logit link and a set of covariates
trtStepWedge

Assign treatment for stepped-wedge design
viewSplines

Plot spline curves
addColumns

Add columns to existing data set
addMultiFac

Add multi-factorial data
addPeriods

Create longitudinal/panel data
addCorGen

Create multivariate (correlated) data - for general distributions
addCompRisk

Generating single competing risk survival variable
addDataDensity

Add data from a density defined by a vector of integers
addMarkov

Add Markov chain
addCorFlex

Create multivariate (correlated) data - for general distributions