Learn R Programming

gllm (version 0.38)

scatter: Create a filter matrix from a summary array of indices

Description

Create a filter matrix that multiplying the vector of counts from a complete contingency table, gives a collapsed contingency table.

Usage

scatter(y,s)

Value

S

A matrix of orthogonal columns of 1s and 0s

Arguments

y

is the observed contingency table. Provides a target length only.

s

is a vector of indices, one for each cell of the full (unobserved) contingency table, representing the appropriate cell of y

Author

David L Duffy

Examples

Run this code
y<-double(3)
z<-1:5
z %*% scatter(y,c(1,1,2,3,3))
## 1+2, 3, 4+5

Run the code above in your browser using DataLab