Zscore {BayesLCA} | R Documentation |
For a fitted model of class blca
, and binary data X
, the probability of class membership for each data point is provided.
Zscore(X, fit = NULL, itemprob = NULL, classprob = NULL)
X |
A binary data matrix. |
fit |
An object of class |
itemprob |
A matrix of item probabilities, conditional on class membership. |
classprob |
A vector denoting class membership probability. |
Calculation of the probability of class membership for a data point relies on two parameters, class membership and item probability. These may be supplied directly to Zscore, or alternatively, a blca
object containing both parameters can be used instead.
A matrix of equal rows to X
and with G, the number of classes, columns, where each row is a score denoting the probability of class membership. Each row should therefore sum to 1.
Zscore.internal
has the same functionality as Zscore
, but is only intended for internal use.
Arthur White
set.seed(1)
type1 <- c(0.8, 0.8, 0.05, 0.2)
type2 <- c(0.2, 0.2, 0.05, 0.8)
x<- rlca(250, rbind(type1,type2), c(0.5,0.5))
fit <- blca.em(x, 2)
fit$Z ## Unique data types
Zscore(x, fit=fit) ## Whole data set
Zscore(c(0, 1, 1, 0), fit=fit) ## Not in data set
Zscore(x, itemprob=rbind(type1,type2), classprob=c(0.5,0.5))