Description Usage Arguments Value References See Also
This function simulates the continuous, ordinal (r >= 2 categories), Poisson, or Negative Binomial variables
used in error_loop
. It is called in each iteration, regenerates all variables, and calculates the
resulting correlation matrix.
This function would not ordinarily be called directly by the user.
1 2 3 | error_vars(marginal, support, method, means, vars, constants, lam, size, prob,
mu, Sigma, rho_calc, q, r, k_cat, k_cont, k_pois, k_nb, Y_cat, Y, Yb, Y_pois,
Y_nb, n, seed)
|
marginal |
a list of length equal |
support |
a list of length equal |
method |
the method used to generate the continuous variables. "Fleishman" uses a third-order polynomial transformation and "Polynomial" uses Headrick's fifth-order transformation. |
means |
a vector of means for the continuous variables |
vars |
a vector of variances |
constants |
a matrix with |
lam |
a vector of lambda (> 0) constants for the Poisson variables (see |
size |
a vector of size parameters for the Negative Binomial variables (see |
prob |
a vector of success probability parameters |
mu |
a vector of mean parameters (*Note: either |
Sigma |
the 2 x 2 intermediate correlation matrix generated by |
rho_calc |
the 2 x 2 final correlation matrix calculated in |
q |
the row index of the 1st variable |
r |
the column index of the 2nd variable |
k_cat |
the number of ordinal (r >= 2 categories) variables |
k_cont |
the number of continuous variables |
k_pois |
the number of Poisson variables |
k_nb |
the number of Negative Binomial variables |
Y_cat |
the ordinal variables generated from |
Y |
the continuous (mean 0, variance 1) variables |
Yb |
the continuous variables with desired mean and variance |
Y_pois |
the Poisson variables |
Y_nb |
the Negative Binomial variables |
n |
the sample size |
seed |
the seed value for random number generation |
A list with the following components:
Sigma
the intermediate MVN correlation matrix
rho_calc
the calculated final correlation matrix generated from Sigma
Y_cat
the ordinal variables
Y
the continuous (mean 0, variance 1) variables
Yb
the continuous variables with desired mean and variance
Y_pois
the Poisson variables
Y_nb
the Negative Binomial variables
Please see references for error_loop
.
ordcont
, rcorrvar
, rcorrvar2
,
error_loop
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.