Learn R Programming

simdata: An R package to create simulated datasets

This package provides lightweight and easy-to-use data generating mechanisms for statistical simulation studies.

Installation

install.packages("simdata")

# Alternatively, install the development version from GitHub:
# install.packages("devtools")
devtools::install_github("matherealize/simdata")

# to also build vignettes locally use
# devtools::install_github("matherealize/simdata", build_vignettes = TRUE)

In case you encounter an http 401 error during installation from GitHub, this is not due to the package itself, but due to rate limits set by GitHub. Please refer to these steps from the remotes Github repository to resolve the issue.

Usage

Please take a look at the package vignettes:

Status and future plans

The package is in active development, but is already used in several simulation studies. We plan to provide a library of data generators for interesting real-world dataset in upcoming versions of the package.

Contact

For feedback and issues when working with the package please create a new Issue at Github or send me an email.

Copy Link

Version

Install

install.packages('simdata')

Monthly Downloads

201

Version

0.4.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Michael Kammer

Last Published

December 3rd, 2024

Functions in simdata (0.4.1)

partial

Define partial function
contains_constant

Check if matrix contains constant column(s)
simdesign_norta

NORTA-based design specification
process_truncate_by_iqr

Truncate columns of datamatrix at datamatrix specific thresholds
cor_to_cov

Convert correlation matrix to covariance matrix
process_truncate_by_threshold

Truncate columns of datamatrix at specified thresholds
plot_cor_network

Visualize fixed correlation structure as a network
plot_estimated_cor_network

Visualize estimated correlation matrix as a network
quantile_functions_from_data

Helper to estimate quantile functions from data for NORTA
simdesign_discunif

Uniform disc sampling design specification
simulate_data

Simulate design matrix
simulate_data_conditional

Simulate data which satisfies certain conditions
do_processing

Post-processing of datamatrix
colapply_functions

Apply list of functions to column of object
function_list

Apply list of functions to input
as_function_list

Create function_list object from list of functions
cor_to_upper

Convert correlation matrix to specification used by cor_from_upper
cor_from_upper

Build correlation matrix
apply_array

Helper to apply functions
estimate_final_correlation

Estimate correlation matrix via simulation
optimize_cor_mat

Find initial correlation matrix for NORTA from target correlation
is_collinear

Check if matrix is collinear
optimize_cor_for_pair

Find pairwise initial correlation for NORTA from target correlation
is_cor_matrix

Check if matrix is a correlation matrix
get_from_function_list

Extract individual functions from function_list
get_names_from_function_list

Extract names of individual functions from function_list
simdesign

Design specification for simulating datasets
simdesign_mvtnorm

Multivariate normal design specification