aggr_data {MultiLCIRT} | R Documentation |
Aggregate data
Description
Given a matrix of configurations (covariates and responses) unit-by-unit, this function finds the corresponding matrix of distinct configurations and the corresponding vector of frequencies (it does not work properly with missing data).
Usage
aggr_data(data, disp=FALSE, fort=FALSE)
Arguments
data |
matrix of covariate and unit-by-unit response configurations |
disp |
to display partial results |
fort |
to use fortran routines when possible |
Value
data_dis |
matrix of distinct configurations |
freq |
vector of corresponding frequencies |
label |
the index of each provided response configuration among the distinct ones |
Author(s)
Francesco Bartolucci - University of Perugia (IT)
Examples
# draw a matrix of random responses and find distinct responses
X = matrix(sample(5,100,replace=TRUE),50,2)
out = aggr_data(X)
# find the distinct responses and the corresponding vector of frequencies
# for naep data
data(naep)
X = as.matrix(naep)
out = aggr_data(X)
length(out$freq)
[Package MultiLCIRT version 2.11 Index]