Description Usage Arguments Value See Also Examples
This function computes the empirical marginal probabilities for binary and ordinal data.
1 | ordmps(ord.dat)
|
ord.dat |
A data frame consisting of binary and ordinal variables. |
A list of length ncol(ord.dat) containing the data and empirical marginal probabilities for each variable in ord.dat.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.