cem_match: Match using CEM

Description Usage Arguments Details Value Examples

View source: R/cem_match.R

Description

A wrapper around CEM to match on refit topics and projection.

Usage

1
2
3
4
5
6
7
8
9
cem_match(
  theta,
  projection,
  treat,
  topic_breaks = c(0, 0.1, 1),
  projection_breaks = 5,
  returnX = FALSE,
  ...
)

Arguments

theta

an output of refit containing the refit topic proportions, theta. If given the argument NULL the function will omit matching on topics.

projection

an output of project containing the projection. If given the argument NULL the function will omit matching on the projection.

treat

the treatment variable.

topic_breaks

the cutpoints used for the topics. If this is a vector it defines the vector of cutpoints. If this is a single number, it determines the number of bins. By default it uses the cutpoints 0,.1,1 which corresponds to bins of less than 10 and more than 10% about a topic.

projection_breaks

the cutpoints used for the projection. If this is a vector it defines the vector of cutpoints. If this is a single number, it determines the number of bins. By default it uses 5 inductively learned bins. See cem for more details.

returnX

a logical which if true adds a copy of the data to the return object as a top level item in the list called X.

...

additional arguments passed to cem

Details

This function is a convenience wrapper around CEM which returns a cem object.

Value

a cem.match object

Examples

1
2
3
4
5
6
#See ?sim for a walkthrough
data(sim)
refitted <- refit(sim_topics, sim_documents, content_level="1")
projection <- project(sim_topics, sim_documents)
matched <- cem_match(refitted,projection=projection, sim_meta$treat,
                     projection_breaks=2)

textmatching documentation built on Aug. 19, 2020, 9:06 a.m.