SimMultinomial function

Simulation of multinomial clustered data

Simulation of multinomial clustered data

Generate a random sample of multinomial observations from a copula-based mixed regression model.

SimMultinomial( parC, parM, clu, xc = NULL, xm = NULL, family, rot = 0, dfC = NULL, offset = NULL )

Arguments

  • parC: copula parameters
  • parM: matrix of dimension (L-1)x k2 of margin parameters; L is the number of levels and k2 is the number of covariates+constant for the margins
  • clu: vector of clusters (can be a factor)
  • xc: matrix of covariates for the copula, not including the constant (can be NULL)
  • xm: matrix of covariates for the margins, not including the constant (can be NULL)
  • family: copula family: "gaussian" , "t" , "clayton" , "joe", "frank" , "gumbel", "plackett"
  • rot: rotation: 0 (default), 90, 180 (survival), or 270
  • dfC: degrees of freedom for student copula (default is NULL)
  • offset: offset for the margins (default is NULL)

Returns

  • y: Simulated factor

Examples

K=50 #number of clusters n=5 #size of each cluster N=n*K set.seed(1) clu=rep(c(1:K),each=n) parC = 2 parM=matrix(c(1,-1,0.5,2),byrow=TRUE,ncol=2) xm = runif(N) y=SimMultinomial(parC,parM,clu,xm=xm,family="clayton",rot=90)

Author(s)

Bruno N. Remillard

  • Maintainer: Bruno N Remillard
  • License: GPL (>= 2)
  • Last published: 2023-11-30

Useful links