countrate: Computation of Rates for Count Data

Description Usage Arguments Value See Also Examples

View source: R/countrate.R

Description

This function computes the empirical rates for count data.

Usage

1
countrate(count.dat)

Arguments

count.dat

A matrix consisting of count variables.

Value

A list of length ncol(count.dat) containing the data and empirical rates for each variable in count.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
24
library(PoisBinOrdNonNor)
set.seed(123)
n<-1e4

lambdas<-list(1, 3)

#generate Poisson data
cmat.star <- find.cor.mat.star(cor.mat = .4 * diag(2) + .6, 
                               no.pois = length(lambdas), 
                               pois.list = lambdas)

cntdata <- genPBONN(n, 
                    no.pois = length(lambdas), 
                    cmat.star = cmat.star, 
                    pois.list = lambdas)

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

cntdata<-data.frame(cntdata)
cntinfo<-countrate(cntdata)

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