View source: R/fleishman_sim.R
fleishman_sim | R Documentation |
Simulates univariate non-normal data by using Fleishman power transformations (Fleishman, 1978; Demirtas & Hedeker, 2007).
fleishman_sim(N=1, coef=NULL, mean=0, sd=1, skew=0, kurt=0)
fleishman_coef(mean=0, sd=1, skew=0, kurt=0)
N |
Number of simulated values |
coef |
Optional list containing coefficients of Fleishman polynomial estimated
by |
mean |
Mean |
sd |
Standard deviation |
skew |
Skewness |
kurt |
(Excess) kurtosis |
For Z \sim N(0,1)
, the Fleishman power normal variable X
is defined as
X=a + bZ + cZ^2 + d Z^3
.
Vector of simulated values (fleishman_sim
) or list of coefficients
(fleishman_coef
).
Demirtas, H., & Hedeker, D. (2008). Imputing continuous data under some non-Gaussian distributions. Statistica Neerlandica, 62(2), 193-205. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/j.1467-9574.2007.00377.x")}
Fleishman, A. I. (1978). A method for simulating non-normal distributions. Psychometrika, 43(4), 521-532. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/BF02293811")}
See also the BinOrdNonNor::Fleishman.coef.NN
function in the
BinOrdNonNor package.
See the nnig_sim
function for simulating a non-normally distributed
multivariate variables.
## Not run:
#############################################################################
# EXAMPLE 1: Simulating values with Fleishman polynomial
#############################################################################
#* define mean, standard deviation, skewness and kurtosis
mean <- .75
sd <- 2
skew <- 1
kurt <- 3
#* compute coefficients of Fleishman polynomial
coeff <- miceadds::fleishman_coef(mean=mean, sd=sd, skew=skew, kurt=kurt)
print(coeff)
# sample size
N <- 1000
set.seed(2018)
#* simulate values based on estimated coefficients
X <- miceadds::fleishman_sim(N=N, coef=coeff)
#* simulate values based on input of moments
X <- miceadds::fleishman_sim(N=N, mean=mean, sd=sd, skew=skew, kurt=kurt)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.