Code Monkey home page Code Monkey logo

Comments (5)

ngreifer avatar ngreifer commented on July 28, 2024

So funny you asked, both of these features are available in the development version of MatchIt on my GitHub. With nearest neighbor matching, when an argument to exact is specified, matching takes place seperately within each level of the exact matching variables, which will speed up execution. I have plans to allow this to be parallelized, too, but I haven't implemented that yet. Also, if you match separately within subgroups (i.e., using different calls to matchit()), you can now use a special rbind() method to bind the several match.data() outputs together into a single output for effect estimation. You do still have to assess balance within each matchit object separately, though, as these cannot be combined. You can be clever and use the rbind() output with cobalt if you retain the unmatched units in the match.data() calls.

To install the devlopment version on my GitHub, you can run devtools::install_github("ngreifer/MatchIt").

from matchit.

nchemine avatar nchemine commented on July 28, 2024

from matchit.

ChristelSwift avatar ChristelSwift commented on July 28, 2024

Hi Noah, is this new feature implemented from MatchIt 4.2.0? I'm trying optimal pair matching with exact matching on some selected variables, and mahalanobis distance on other variables.

I can't get it to work with the full dataset which has about 500k rows (of which about 150k are in the treated group), i keep running out of memory.... Do i have to use a specific syntax for the matching to take place separately in each level of the exact matching variables? I'm currently using something like this:

match1 <- matchit(
  experiment_group ~ .,
  method = "optimal", 
  mahvars = ~ age + children + comedy + drama + ents + factual + learning + music + news + sport , 
  exact = c("gender", "acorn_category", "hf"),
  data = db
)

from matchit.

ngreifer avatar ngreifer commented on July 28, 2024

Yes, that is a feature in 4.2.0, but only for nearest neighbor matching. Exact matching with optimal matching is handled by the optmatch package, which may not be able to handle such a large dataset. The ability to handle large datasets is an advantage of nearest neighbor over optimal matching. By setting verbose = TRUE with method = "nearest" you can also track the progress within each category of the exact variables. In general, nearest neighbor and optimal matching yield similar results, so you aren't losing anything by using nearest neighbor.

from matchit.

ChristelSwift avatar ChristelSwift commented on July 28, 2024

thank you so much for such a prompt reply, i'll try nearest!

from matchit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.