Description Usage Arguments Value References See Also Examples
This function calculates the beta (slope) coefficients used in nonnormsys
by the techniques of Headrick and Beasley (doi: 10.1081/SAC-120028431). These coefficients are determined based on the
correlations between independent variables X_{(pj)} for a given outcome Y_p, for p = 1, ..., M
, the
correlations between that outcome Y_p and the X_{(pj)} terms, and the variances. If there are continuous mixture variables and the
matrices in corr.yx
are specified in terms of correlations between outcomes and non-mixture and mixture variables, then the
solutions are the slope coefficients for the non-mixture and mixture variables. In this case, the number of columns of the matrices of corr.yx
should not match the dimensions of the matrices in corr.x
. The correlations in corr.x
will be calculated in terms of non-mixture and
mixture variables using rho_M1M2
and rho_M1Y
. If there are continuous mixture variables and the
matrices in corr.yx
are specified in terms of correlations between outcomes and non-mixture and components of mixture variables,
then the solutions are the slope coefficients for the non-mixture and components of mixture variables. In this case, the number of columns of the matrices of corr.yx
should match the dimensions of the matrices in corr.x
. The vignette Theory and Equations for Correlated Systems of
Continuous Variables gives the equations, and the vignette Correlated Systems of Statistical Equations with Non-Mixture and
Mixture Continuous Variables gives examples. There are also vignettes in SimCorrMix
which provide more details on continuous
non-mixture and mixture variables.
1 2 3 |
corr.yx |
a list of length |
corr.x |
list of length |
vars |
a list of same length as |
mix_pis |
a list of same length as |
mix_mus |
a list of same length as |
mix_sigmas |
a list of same length as |
error_type |
"non_mix" if all error terms have continuous non-mixture distributions, "mix" if all error terms have continuous mixture distributions, defaults to "non_mix" |
n |
the number of sets of random uniform(0, 1) numbers used as starting values in |
seed |
the seed for random number generation |
betas
a matrix of slope coefficients where rows represent the outcomes; extra zeros are appended at the end of a row
if that outcome has fewer X_{(pj)} terms
Headrick TC, Beasley TM (2004). A Method for Simulating Correlated Non-Normal Systems of Linear Statistical Equations. Communications in Statistics - Simulation and Computation, 33(1). doi: 10.1081/SAC-120028431
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # Example: system of three equations for 2 independent variables, where each
# error term has unit variance, from Headrick & Beasley (2002)
corr.yx <- list(matrix(c(0.4, 0.4), 1), matrix(c(0.5, 0.5), 1),
matrix(c(0.6, 0.6), 1))
corr.x <- list()
corr.x[[1]] <- corr.x[[2]] <- corr.x[[3]] <- list()
corr.x[[1]][[1]] <- matrix(c(1, 0.1, 0.1, 1), 2, 2)
corr.x[[1]][[2]] <- matrix(c(0.1974318, 0.1859656, 0.1879483, 0.1858601),
2, 2, byrow = TRUE)
corr.x[[1]][[3]] <- matrix(c(0.2873190, 0.2589830, 0.2682057, 0.2589542),
2, 2, byrow = TRUE)
corr.x[[2]][[1]] <- t(corr.x[[1]][[2]])
corr.x[[2]][[2]] <- matrix(c(1, 0.35, 0.35, 1), 2, 2)
corr.x[[2]][[3]] <- matrix(c(0.5723303, 0.4883054, 0.5004441, 0.4841808),
2, 2, byrow = TRUE)
corr.x[[3]][[1]] <- t(corr.x[[1]][[3]])
corr.x[[3]][[2]] <- t(corr.x[[2]][[3]])
corr.x[[3]][[3]] <- matrix(c(1, 0.7, 0.7, 1), 2, 2)
vars <- list(rep(1, 3), rep(1, 3), rep(1, 3))
calc_betas(corr.yx, corr.x, vars)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.