UNNATI N.
  • Home
  • Research
  • Blog
  • Contact
  • Personal

Let's Learn Together

Data-driven Marketing for Theory and Practice

R: Creating Panel data from propensity score matched samples using the matchit package

2/18/2018

1 Comment

 
This code uses the MatchIt package for propensity score matching to demonstrate with and without replacement Nearest Neighbor matching. The additional extension it offers is to create panel data using matched sample in both instances (particularly non-trivial for with replacement matches).
1 Comment
Antonin
3/18/2020 01:53:22 pm

Hi,
Thank you for this excellent post.
I face an issue while running it :
It seems that my treated and un-treated columns are the same. The underneath table shows the first row of matches_df.
Any idea where does that comes from?
Thanks in advance,
Antonin

X1 X2 treat control
23 23 1629 1 5405
36 36 128 2 6
45 45 1627 3 5405
81 81 79 4 4
107 107 409 5 21
133 133 435 6 23
156 156 1201 7 1578
172 172 165 8 8
202 202 32 9 2
225 225 227 10 10
249 249 253 11 11
256 256 1259 12 1931
276 276 1386 13 2799
283 283 290 14 14
298 298 235 15 11
301 301 205 16 10
306 306 319 17 17
322 322 327 18 18
352 352 347 19 19
365 365 669 20 35

Reply



Leave a Reply.

    DISCOVER

    Exciting marketing research, cutting-edge methods, and highlights from marketing conferences

    Categories

    All
    Event Highlights
    Machine Learning
    Media Mentions
    Research
    R Programming
    Teaching

    Archives

    December 2022
    August 2022
    June 2022
    December 2021
    June 2021
    January 2021
    November 2020
    September 2020
    August 2020
    June 2020
    May 2020
    August 2019
    January 2019
    June 2018
    April 2018
    February 2018
    December 2017
    October 2017
    August 2017

Powered by Create your own unique website with customizable templates.
  • Home
  • Research
  • Blog
  • Contact
  • Personal