ordmps: Computation of Marginal Probabilities for Binary and Ordinal...

Description Usage Arguments Value See Also Examples

View source: R/ordmps.R

Description

This function computes the empirical marginal probabilities for binary and ordinal data.

Usage

1
ordmps(ord.dat)

Arguments

ord.dat

A data frame consisting of binary and ordinal variables.

Value

A list of length ncol(ord.dat) containing the data and empirical marginal probabilities for each variable in ord.dat.

See Also

MI, MVN.corr

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
library(PoisBinOrdNonNor)
set.seed(123)
n<-1e4
mps<-list(c(.2, .8), c(.6, 0, .3, .1))

#generate ordinal data
cmat.star <- find.cor.mat.star(cor.mat = .8 * diag(2) + .2, 
                               no.ord = length(mps),
                               ord.list = mps)

orddata <- genPBONN(n, 
                    no.ord = length(mps), 
                    cmat.star = cmat.star, 
                    ord.list = mps)

#set a sample of each variable to missing
orddata<-apply(orddata, 2, function(x) {
  x[sample(1:n, size=n/10)]<-NA
  return(x)
})

orddata<-data.frame(orddata)
ordinfo<-ordmps(orddata)

MultiVarMI documentation built on May 1, 2019, 8:44 p.m.