DelLessData | R Documentation |
Removes groups of missing data patterns with number of cases less than or equal to a specified value (ncases).
DelLessData(data, ncases = 0)
data |
A matrix consisting of at least two columns. Values must be numerical with missing data indicated by NA. |
ncases |
Missing data pattern groups with ncases number of cases or less will be removed from the data set. |
data |
A matrix of reaaranged data, according to missing data patterns, with missing data patterns having less than ncases number of cases removed. |
patused |
A matrix indicating the missing data patterns in the data set; observed variable(s) are indiated by 1's' and missing variables are indicated by NA's. |
patcnt |
A vector consisting of the number of cases corresponding to each pattern in patused. |
spatcnt |
Cumulative sum of elements of patcnt. |
g |
Number of missing data patterns. |
caseorder |
A mapping of case number indices from output data (rearranged data) to input data. |
removedcases |
The index of cases that were removed from the original data set |
Mortaza Jamshidian, Siavash Jalal, and Camden Jansen
set.seed <- 50
n <- 200
p <- 4
pctmiss <- 0.2
y <- matrix(rnorm(n * p),nrow = n)
missing <- matrix(runif(n * p), nrow = n) < pctmiss
y[missing] <- NA
out <- DelLessData(data=y, ncases = 4)
dim(y)
dim(out$data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.