matlist: From list of feasible assignments to cost matrix.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/matlist.R

Description

Transforms the list of suitable applicants into the equivalent cost matrix.

Usage

1

Arguments

x

An ordered list of applicants for a set of jobs. The i^{th} element of the list contains applicants suitable for job i. Equivalently, an ordered list of controls where the i^{th} element of the list contains controls matchable with the i^{th} treated unit.

Details

In statistical matching problems the input is usually the cost matrix while in assignment problems is the list of assignable elements. Functions matlist and listmat go back and forth these two representations of the input.

Value

The cost matrix of the assignment problem. The (i,j) entry of the matrix is zero if the j^{th} applicant is assignable to the i^{th} job and otherwise. Equivalently, the (i,j) entry of the matrix is zero if the j^{th} control unit can be matched to the i^{th} treated unit and otherwise.

Author(s)

Massimo Cannas <massimo.cannas@unica.it>

See Also

See also the reverse function listmat.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# a list of feasible applicants for five jobs	
M1<-c("A","B","C")
M2<-c("A","C")
M3<-c("B")
M4<-c("A","C")
M5<-c("A","D")
M  <-list(M1,M2,M3,M4,M5)
M

# the corresponding cost matrix
m<-listmat(M)

# back to the list
l<-matlist(m)

OSDR documentation built on May 2, 2019, 6:59 a.m.