propensity score matching with matchit I am trying to use the package matchit fo propensity score matching on data set (educational stuff) with 52000 observations and a number of variables. For example, I use the command
m.out1data <- matchit(snew ~ woman + asian + black + white + other + multi + tf + fg + age + int + sd , data = nsc,method = "full")

My problem is that various methods (for example the full method) won't run because it requires a vector size larger than 2^32 -1 bytes. Other methods such as the genetic method will not complete.
I am surprised that R doesn't seem to be able to handle this because the number of sample is actually not that large. Is this to be expected or is there a simple way to trace down the issue?
 A: The problem is that the distance matrix is likely around 500 million values (i.e., one for each possible pairing of treated and control). Full matching, optimal matching, and genetic matching all require the distance matrix to be computed in order to do the matching. This may simply be too big to be done effectively in R's architecture.
If you like full matching, try using subclassification ('method = "subclass"`) instead. The results tend to be similar. Remember to use a large number of subclasses (e.g., try 500 subclasses, not 5). Subclassification is extremely fast (perhaps the fastest matching method) because no distance matrix has to be created and the subclassification is done only on a single variable (the propensity score).
You can also try nearest neighbor matching. The way it is implemented in MatchIt does not involve creating the entire distance matrix. Each row of the distance matrix is created and then destroyed so less memory is used at the expense of some speed performance. It may still take some time with such a large dataset, but by setting verbose = TRUE, you can see a progress bar that will tell you how long it will take. Using variable-ratio matching or matching with replacement can mimic some of the desirable qualities of full matching. These are described in the documentation.
