Questions tagged [matchit]

12 questions
0
votes
0 answers

Identifying matched unexposed observations to exposed observations from two different dataframes in R

I have two dataframes in R which I need to use to find the two best matches (or one if only one possible or 0 if none possible) for each one exposed individual. One dataframe (called df) is a dataframe with 1,000 observations, of which 34…
Pontus Hedberg
  • 301
  • 1
  • 2
  • 9
0
votes
1 answer

How the matching order is determined when replace = TRUE in R matchIt

I'm working on propensity score matching, with replacement. I am using matchIt package in R. But I found that the argument m.order="random" seems not to work after I specify replace=TRUE. For example, I created a sample dataset: testdata =…
0
votes
1 answer

How can I use the MatchIt package from R to match control and case patients on age and multiple diagnosis codes (ICD10)?

I have case patients and am trying to match controls based of age (easy part) and ICD10 using the MatchIt package in R. My problem is that there are multiple ICD codes for a given patient. For example, a 20 year old case case patient may have 2 ICD…
0
votes
1 answer

Nearest Neighbor Matching in R using the built-in MatchIt-function

I'm trying to implement a simple nearest neighbor matching for bonds that matches bonds from a treatment group with certain characteristics to bonds from a control group with similar characteristics. For the distance I wanted to use the Mahanolobis…
0
votes
0 answers

Extract y data values from mirrored histogram using R MatchIt and cobalt

I use R code in the backend of my application to generate different plots such as histograms after conducting matching. In order to show the plots in the front end of my application I want to extract all data values and rebuild them using…
0
votes
0 answers

How do you run matching sequentially on unmatched treated? [R]

I'd like to do exact matching as much as possible but without losing treated without a match. Below is an example of what I mean by sequential matching. Is this a good idea? A real world example would need to run this more often, and so I'm looking…
Rico
  • 1,998
  • 3
  • 24
  • 46
0
votes
1 answer

Extracting matched sample dataframe from MatchThem

I am using the R package MatchThem to match a dataset that contains 19 control samples and 13 case samples. After running the MatchThem command with nearest-neighbor one-to-one matching without replacement, I see in the summary that the matched…
0
votes
1 answer

Matching controls with time-dependent covariates to treated cases with varying treatment time without replacement

I want to estimate the effect of treatment X on variable Y by matching for covariates balance on treatment and control groups using R and the MatchIt package. I'm compiling a retrospective cohort, and the treatment-time varies across the treatment…
arielhasidim
  • 694
  • 10
  • 19
0
votes
0 answers

What does Call: do? -- Call: glm(formula = formula, family = binomial(logit), data = data)

I am currently working a Propensity Score Analysis based of off "Propensity score matching with R: conventional methods and new features" by Qin-Yu Zhao1#, Jing-Chao Luo2#, Ying Su2, Yi-Jie Zhang2, Guo-Wei Tu2, Zhe…
Lunde
  • 1
  • 1
0
votes
0 answers

Matching with matchit with flexible exact argument

I have some simple data of housing sales, divided into a control and a treatment group. I would like to get a matched control group that is similar to the treatment group on some characteristics (size of the house, age, number of rooms) using the…
SCW16
  • 403
  • 2
  • 4
  • 10
0
votes
0 answers

Problems with distance matrix - R propensity score matching

I have a cohort with about 10 covariates (e.g age, sex, region, index_agent, etc) for which I am trying to match cases to controls in a 1:3 ratio. An additional criteria I have for this match is that my variable called match_time must be greater for…
0
votes
0 answers

How to get the matched groups when using exact matching with MatchIt in R?

I try to do a "simple" exact 1 to 1 matching. I would expect that the resulting data consist of two groups with the same size. But in my MWE it looks like this where the groups are not of thes same size. Sample Sizes: Control…
buhtz
  • 10,774
  • 18
  • 76
  • 149