decimate_mat: Decimates a data matrix based on the patterns the data matrix...

View source: R/decimate_mat.R

decimate_matR Documentation

Decimates a data matrix based on the patterns the data matrix was simulated from.

Description

Given a data matrix, M, simulated from a ground-truth pattern matrix, P, decimate_mat corrupts M row by row to produce M', such that every row of M' has every value missing besides exactly one random observation corresponding to each pattern in P (where the patterns are the rows of P).

Usage

decimate_mat(mat, patterns)

Arguments

mat

The matrix to be decimated.

patterns

The ground truth patterns the matrix was simulated from.

Value

The decimated matrix

See Also

decimate_row

Examples

pattern <- t(cbind(c(1,1,1,0,0), c(0,0,0,1,1)))
scores <- matrix(rnorm(10), 5, 2)
sim_mat <- scores %*% pattern
decimated_mat <- decimate_mat(sim_mat,  patterns=pattern)

Columbia-PRIME/PCPhelpers documentation built on April 24, 2022, 7:57 p.m.