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