Learn R Programming

optmatch (version 0.10.8)

subdim: Returns the dimension of each valid subproblem

Description

Returns a list containing the dimensions of all valid subproblems.

Usage

subdim(x)

# S3 method for InfinitySparseMatrix subdim(x)

# S3 method for matrix subdim(x)

# S3 method for BlockedInfinitySparseMatrix subdim(x)

# S3 method for optmatch.dlist subdim(x)

Value

A data frame listing the dimensions of each valid subproblem. Any subproblems with 0 controls or 0 treatments will be ignored. The names of the entries in the list will be the names of the subproblems, if they exist. There will be two rows, named "treatments" and "controls".

Arguments

x

A distance specification to get the sub-dimensions of.

Examples

Run this code
em <- exactMatch(pr ~ pt, data=nuclearplants)
m1 <- fullmatch(pr ~ t1 + t2, within=em, data=nuclearplants)
stratumStructure(m1)
(subdims_em <- subdim(em))
m2 <- fullmatch(pr ~ t1 + t2, within=em, data=nuclearplants,
                mean.controls=pmin(1.5, subdims_em["controls",] / subdims_em["treatments",])
                )
stratumStructure(m2)
                

Run the code above in your browser using DataLab