intermat: Calculates and assembles the intermediate correlation matrix...

Description Usage Arguments Value References See Also Examples

View source: R/intermat.R

Description

This function computes and assembles the correlation entries for the intermediate multivariate normal data.

Usage

1
2
intermat(no_pois, no_bin, no_ord, no_norm, corr_mat, prop_vec_bin, prop_vec_ord,
 lam_vec, nor_mean, nor_var)

Arguments

no_pois

Number of the count variables.

no_bin

Number of the binary variables.

no_ord

Number of the ordinal variables.

no_norm

Number of the normal variables.

corr_mat

Pre-specified correlation matrix for the multivariate data.

prop_vec_bin

Vector of probabilities for the binary variables.

prop_vec_ord

Vector of probabilities for the ordinal variables.

lam_vec

Vector of rate parameters for the count variables.

nor_mean

Vector of means for the normal variables.

nor_var

Vector of variances for the normal variables.

Value

The intermediate correlation matrix that will be used later for multivariate normal data simulation.

References

Barberio, A. & Ferrari, P.A. (2015). GenOrd: Simulation of discrete random variables with given correlation matrix and marginal distributions. https://cran.r-project.org/web/packages/GenOrd/index.html.

Demirtas, H. & Hedeker, D. (2011). A practical way for computing approximate lower and upper correlation bounds. American Statistician, 65(2), 104-109.

Demirtas, H. & Hedeker, D. (2016). Computing the point-biserial correlation under any underlying continuous distribution. Communications in Statistics–Simulation and Computation, 45(8), 2744-2751.

Ferrari, P.A. and Barberio, A. (2012). Simulating ordinal data. Multivariate Behavioral Research, 47(4), 566-589.

See Also

corr.nn4bb, corr.nn4bn, corr.nn4on, corr.nn4pbo, corr.nn4pn, corr.nn4pp, and validation.specs.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
num_pois<-2
num_bin<-1
num_ord<-2
num_norm<-1
lamvec=sample(10,2)
pbin=runif(1)
pord=list(c(0.3, 0.7), c(0.2, 0.3, 0.5))
nor.mean=3.1
nor.var=0.85
M=
c(-0.05, 0.26, 0.14, 0.09, 0.14, 0.12, 0.13, -0.02, 0.17, 0.29, -0.04, 0.19, 0.10, 0.35, 0.39)
N=diag(6)
N[lower.tri(N)]=M
TV=N+t(N)
diag(TV)<-1
intmat<-
intermat(num_pois,num_bin,num_ord,num_norm,corr_mat=TV,pbin,pord,lamvec,nor.mean,nor.var)


## End(Not run)

PoisBinOrdNor documentation built on March 22, 2021, 9:08 a.m.