Learn R Programming

textmatching (version 0.1.0)

cem_match: Match using CEM

Description

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

Usage

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

Value

a cem.match object

Details

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

Examples

Run this code
# NOT RUN {
#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)
# }

Run the code above in your browser using DataLab