correctXMissingness {RCM} | R Documentation |
Replace missing entries in X by their expectation to set their contribution to the estimating equations to zero
correctXMissingness(X, mu, allowMissingness, naId)
X |
the matrix of counts |
mu |
the matrix of expectations |
allowMissingness |
A boolean, are missing values present |
naId |
The numeric index of the missing values in X |
The matrix X with the NA entries replaced by the corresponding entries in mu
This may seem like a hacky approach, but it avoids having to deal with NAs in functions like crossprod().