Learn R Programming

RealSurvSim (version 1.0.0)

data_simul_Estim: Simulate Data Based on Parametric Distribution Estimates

Description

This function simulates data based on parameter estimates from a specified parametric distribution. It fits a chosen distribution to the original dataset and samples new values from this fitted distribution. Supported distributions include "inverse_gamma", "llogis" (log-logistic), "gumbel". "log-normal", "gamma", "exp", "cauchy".

Usage

data_simul_Estim(orig_vals, n = NULL, distrib = "exp")

Value

Numeric vector of n simulated values based on the fitted parametric distribution.

Arguments

orig_vals

Numeric vector of values from the original dataset.

n

Integer specifying the number of observations to simulate. If NULL, the function simulates the same number of observations as in the original dataset. Defaults to NULL.

distrib

Character; one of "inverse_gamma", "llogis", "gumbel", "exp", "gamma", "normal", or "cauchy".

Examples

Run this code
original_data <- rnorm(100, mean = 50, sd = 10)
simulated_data <- data_simul_Estim(orig_vals = original_data, n = 100, distrib = "inverse_gamma")

Run the code above in your browser using DataLab