MatchIt: Full Matching - Long Vector Error

287 Views Asked by At

I am running an analysis to assess the land conservation policy impact on land use change at parcel level. To address the non-random nature of conservation program enrollment, I am running a matching analysis between treated and non-treated parcel level data. I am getting this error when I am trying to run a full matching using MatchIt package.

Error in cbind(treatmentids, controlids) : 
long vectors not supported yet: ../include/Rinlinedfuns.h:535

The configuration I am using is:

m1.out <- matchit(formula = Y ~ X1 + X2 + ..... Xn, data = dataframe, 
                   method = "full", distance = 'glm', link = 'logit',
                   estimand = 'ATT', ratio = 1, pop.size = 16)

Where X1 .. Xn are continuous covariates, Y is a binary treatment variable. The dataset contains 121226 rows out of which 51693 are treatment and the rest are control samples.

I am running R (4.0.2) with MatchIt(4.3.4) on a windows machine. Genetic or nearest neighbor matching methods are running without any issues. I appreciate any help on this.

1

There are 1 best solutions below

1
On BEST ANSWER

This is an error from optmatch. The problem is too big for optmatch::fullmatch(), the function matchit() calls with method = "full", to handle. This is because fullmatch() does a search over all pairwise distances, which in this case is over 2.5 billion in number. The problem may simply be infeasible for full matching. See here for the same problem.

Some things you can try are to impose a very strict caliper, which reduces the number of eligible nodes, or add an exact matching constraint using the exact argument, which splits the problem into smaller chunks that may be more manageable. You can also try using subclassification with a large number of subclasses, which approximates full matching.

Also note that the ratio and pop.size arguments do nothing with full matching, so you should exclude them from your call to matchit().