Apply functions (only sample at the moment) over ovaribale indices
Usage
CollapseMarginal(variable, cols, fun = "mean", probs = NULL, ...)
Arguments
variable
an ovariable
cols
vector of column names or indices to collapse
fun
character name of function to be used to summarize
probs
list of vectors defining the distribution of values in a column index
…
excess arguments are ignored
Value
Input ovariable with possibly lighter output.
Details
Samples over a fully defined column index (marginal) treating it as a nuisance parameter.
Increases the joint distribution uncertainty (loses information). Weighted sampling is also possible.
Used to streamline heavy models (output has fewer rows of data).