sim_sample_enr: Simulate random sampling in extended data

View source: R/enrichment.R

sim_sample_enrR Documentation

Simulate random sampling in extended data

Description

Simulate random sampling for NA entries in extended data and check stability of resulting p-values for the parameters for an indicated number of random sampling simulations.

Usage

sim_sample_enr(plist, path, clustdat, clustno, n_sim, numeric, categorical)

Arguments

plist

List storing patient time series data (also see function: patient_list)

path

Path where enrichment csv file is stored

clustdat

Object of type list storing clustering data (also see function: clust_matrix)

clustno

Cluster number of interest

n_sim

Number of simulations

Details

It allows the sampling in NA entries to be repeated for each parameter in the extended data set. The primary objective here is to validate the random sampling process for missing data by running many simulations and comparing the resultant p-values. An extended data frame with NA elements is saved as a simulation foundation. This data frame will always serve as the foundation for any subsequent simulations added. Following that, the program runs through each NA item in the dataset and generates a random sample of the current parameter’s distribution. After completing this step for each parameter, the function generates the associated p-values as explained in enr_obs_clust.

Value

Object of type list storing the received p-values for each parameter in a vector and boxplot visualizing the received p-values

Examples

list <- patient_list(
"https://raw.githubusercontent.com/MrMaximumMax/FBCanalysis/master/demo/phys/data.csv",
GitHub = TRUE)
#Sampling frequency is supposed to be daily
path <- 'https://raw.githubusercontent.com/MrMaximumMax/FBCanalysis/master/demo/enrich/enrichment.csv'
test <- sim_sample_enr(list,path,clustering,1,100, numeric = "anova", categorical = "fe")
sim_sample_enr <- function(plist, path, clustdat, clustno, n_sim)


MrMaximumMax/FBCanalysis documentation built on June 23, 2022, 8:21 p.m.