Running examples in 'MatchIt-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: matchit
> ### Title: Matching for Causal Inference
> ### Aliases: matchit MatchIt print.matchit
> 
> ### ** Examples
> 
> data("lalonde")
> 
> # Default: 1:1 NN PS matching w/o replacement
> 
> m.out1 <- matchit(treat ~ age + educ + race + nodegree +
+                    married + re74 + re75, data = lalonde)
> m.out1
A matchit object
 - method: 1:1 nearest neighbor matching without replacement
 - distance: Propensity score
             - estimated with logistic regression
 - number of obs.: 614 (original), 370 (matched)
 - target estimand: ATT
 - covariates: age, educ, race, nodegree, married, re74, re75
> summary(m.out1)

Call:
matchit(formula = treat ~ age + educ + race + nodegree + married + 
    re74 + re75, data = lalonde)

Summary of Balance for All Data:
           Means Treated Means Control Std. Mean Diff. Var. Ratio eCDF Mean
distance          0.5774        0.1822          1.7941     0.9211    0.3774
age              25.8162       28.0303         -0.3094     0.4400    0.0813
educ             10.3459       10.2354          0.0550     0.4959    0.0347
raceblack         0.8432        0.2028          1.7615          .    0.6404
racehispan        0.0595        0.1422         -0.3498          .    0.0827
racewhite         0.0973        0.6550         -1.8819          .    0.5577
nodegree          0.7081        0.5967          0.2450          .    0.1114
married           0.1892        0.5128         -0.8263          .    0.3236
re74           2095.5737     5619.2365         -0.7211     0.5181    0.2248
re75           1532.0553     2466.4844         -0.2903     0.9563    0.1342
           eCDF Max
distance     0.6444
age          0.1577
educ         0.1114
raceblack    0.6404
racehispan   0.0827
racewhite    0.5577
nodegree     0.1114
married      0.3236
re74         0.4470
re75         0.2876


Summary of Balance for Matched Data:
           Means Treated Means Control Std. Mean Diff. Var. Ratio eCDF Mean
distance          0.5774        0.3629          0.9739     0.7566    0.1321
age              25.8162       25.3027          0.0718     0.4568    0.0847
educ             10.3459       10.6054         -0.1290     0.5721    0.0239
raceblack         0.8432        0.4703          1.0259          .    0.3730
racehispan        0.0595        0.2162         -0.6629          .    0.1568
racewhite         0.0973        0.3135         -0.7296          .    0.2162
nodegree          0.7081        0.6378          0.1546          .    0.0703
married           0.1892        0.2108         -0.0552          .    0.0216
re74           2095.5737     2342.1076         -0.0505     1.3289    0.0469
re75           1532.0553     1614.7451         -0.0257     1.4956    0.0452
           eCDF Max Std. Pair Dist.
distance     0.4216          0.9740
age          0.2541          1.3938
educ         0.0757          1.2474
raceblack    0.3730          1.0259
racehispan   0.1568          1.0743
racewhite    0.2162          0.8390
nodegree     0.0703          1.0106
married      0.0216          0.8281
re74         0.2757          0.7965
re75         0.2054          0.7381

Percent Balance Improvement:
           Std. Mean Diff. Var. Ratio eCDF Mean eCDF Max
distance              45.7     -239.6      65.0     34.6
age                   76.8        4.6      -4.2    -61.1
educ                -134.8       20.4      31.2     32.1
raceblack             41.8          .      41.8     41.8
racehispan           -89.5          .     -89.5    -89.5
racewhite             61.2          .      61.2     61.2
nodegree              36.9          .      36.9     36.9
married               93.3          .      93.3     93.3
re74                  93.0       56.8      79.1     38.3
re75                  91.2     -800.7      66.3     28.6

Sample Sizes:
          Control Treated
All           429     185
Matched       185     185
Unmatched     244       0
Discarded       0       0

> 
> # 1:1 NN Mahalanobis distance matching w/ replacement and
> # exact matching on married and race
> 
> m.out2 <- matchit(treat ~ age + educ + race + nodegree +
+                    married + re74 + re75, data = lalonde,
+                    distance = "mahalanobis", replace = TRUE,
+                    exact = ~ married + race)
> m.out2
A matchit object
 - method: 1:1 nearest neighbor matching with replacement
 - distance: Mahalanobis
 - number of obs.: 614 (original), 263 (matched)
 - target estimand: ATT
 - covariates: age, educ, race, nodegree, married, re74, re75
> summary(m.out2)

Call:
matchit(formula = treat ~ age + educ + race + nodegree + married + 
    re74 + re75, data = lalonde, distance = "mahalanobis", exact = ~married + 
    race, replace = TRUE)

Summary of Balance for All Data:
           Means Treated Means Control Std. Mean Diff. Var. Ratio eCDF Mean
age              25.8162       28.0303         -0.3094     0.4400    0.0813
educ             10.3459       10.2354          0.0550     0.4959    0.0347
raceblack         0.8432        0.2028          1.7615          .    0.6404
racehispan        0.0595        0.1422         -0.3498          .    0.0827
racewhite         0.0973        0.6550         -1.8819          .    0.5577
nodegree          0.7081        0.5967          0.2450          .    0.1114
married           0.1892        0.5128         -0.8263          .    0.3236
re74           2095.5737     5619.2365         -0.7211     0.5181    0.2248
re75           1532.0553     2466.4844         -0.2903     0.9563    0.1342
           eCDF Max
age          0.1577
educ         0.1114
raceblack    0.6404
racehispan   0.0827
racewhite    0.5577
nodegree     0.1114
married      0.3236
re74         0.4470
re75         0.2876


Summary of Balance for Matched Data:
           Means Treated Means Control Std. Mean Diff. Var. Ratio eCDF Mean
age              25.8162       24.8973          0.1284     0.8265    0.0330
educ             10.3459       10.5784         -0.1156     0.9046    0.0179
raceblack         0.8432        0.8432          0.0000          .    0.0000
racehispan        0.0595        0.0595         -0.0000          .    0.0000
racewhite         0.0973        0.0973          0.0000          .    0.0000
nodegree          0.7081        0.5892          0.2616          .    0.1189
married           0.1892        0.1892          0.0000          .    0.0000
re74           2095.5737     1780.4016          0.0645     1.8106    0.0429
re75           1532.0553     1161.2419          0.1152     2.0101    0.0258
           eCDF Max Std. Pair Dist.
age          0.1676          0.3400
educ         0.1189          0.3038
raceblack    0.0000          0.0000
racehispan   0.0000          0.0000
racewhite    0.0000          0.0000
nodegree     0.1189          0.3329
married      0.0000          0.0000
re74         0.2000          0.2483
re75         0.0811          0.2086

Percent Balance Improvement:
           Std. Mean Diff. Var. Ratio eCDF Mean eCDF Max
age                   58.5       76.8      59.5     -6.2
educ                -110.3       85.7      48.4     -6.8
raceblack            100.0          .     100.0    100.0
racehispan           100.0          .     100.0    100.0
racewhite            100.0          .     100.0    100.0
nodegree              -6.8          .      -6.8     -6.8
married              100.0          .     100.0    100.0
re74                  91.1        9.7      80.9     55.3
re75                  60.3    -1462.3      80.8     71.8

Sample Sizes:
              Control Treated
All            429.       185
Matched (ESS)   34.96     185
Matched         78.       185
Unmatched      351.         0
Discarded        0.         0

> 
> # 2:1 NN Mahalanobis distance matching within caliper defined
> # by a probit pregression PS
> 
> m.out3 <- matchit(treat ~ age + educ + race + nodegree +
+                    married + re74 + re75, data = lalonde,
+                    distance = "glm", link = "probit",
+                    mahvars = ~ age + educ + re74 + re75,
+                    caliper = .1, ratio = 2)
> m.out3
A matchit object
 - method: 2:1 nearest neighbor matching without replacement
 - distance: Mahalanobis [matching]
             Propensity score [caliper]
             - estimated with probit regression
 - caliper: <distance> (0.029)
 - number of obs.: 614 (original), 257 (matched)
 - target estimand: ATT
 - covariates: age, educ, race, nodegree, married, re74, re75
> summary(m.out3)

Call:
matchit(formula = treat ~ age + educ + race + nodegree + married + 
    re74 + re75, data = lalonde, distance = "glm", link = "probit", 
    mahvars = ~age + educ + re74 + re75, caliper = 0.1, ratio = 2)

Summary of Balance for All Data:
           Means Treated Means Control Std. Mean Diff. Var. Ratio eCDF Mean
distance          0.5773        0.1817          1.8276     0.8777    0.3774
age              25.8162       28.0303         -0.3094     0.4400    0.0813
educ             10.3459       10.2354          0.0550     0.4959    0.0347
raceblack         0.8432        0.2028          1.7615          .    0.6404
racehispan        0.0595        0.1422         -0.3498          .    0.0827
racewhite         0.0973        0.6550         -1.8819          .    0.5577
nodegree          0.7081        0.5967          0.2450          .    0.1114
married           0.1892        0.5128         -0.8263          .    0.3236
re74           2095.5737     5619.2365         -0.7211     0.5181    0.2248
re75           1532.0553     2466.4844         -0.2903     0.9563    0.1342
           eCDF Max
distance     0.6413
age          0.1577
educ         0.1114
raceblack    0.6404
racehispan   0.0827
racewhite    0.5577
nodegree     0.1114
married      0.3236
re74         0.4470
re75         0.2876


Summary of Balance for Matched Data:
           Means Treated Means Control Std. Mean Diff. Var. Ratio eCDF Mean
distance          0.5113        0.4932          0.0835     1.0779    0.0253
age              26.0721       24.9324          0.1593     0.4302    0.0931
educ             10.4144       10.3514          0.0314     0.6279    0.0171
raceblack         0.7387        0.7252          0.0372          .    0.0135
racehispan        0.0991        0.0946          0.0190          .    0.0045
racewhite         0.1622        0.1802         -0.0608          .    0.0180
nodegree          0.6667        0.6396          0.0594          .    0.0270
married           0.1892        0.2297         -0.1035          .    0.0405
re74           3016.7936     2277.2506          0.1513     1.8730    0.0565
re75           2023.1731     1525.9838          0.1544     2.0215    0.0434
           eCDF Max Std. Pair Dist.
distance     0.1441          0.0860
age          0.3198          0.9477
educ         0.0586          0.7324
raceblack    0.0135          0.0565
racehispan   0.0045          0.4924
racewhite    0.0180          0.3236
nodegree     0.0270          0.5725
married      0.0405          0.4722
re74         0.2117          0.5512
re75         0.1081          0.5885

Percent Balance Improvement:
           Std. Mean Diff. Var. Ratio eCDF Mean eCDF Max
distance              95.4       42.5      93.3     77.5
age                   48.5       -2.7     -14.5   -102.8
educ                  42.9       33.7      50.8     47.4
raceblack             97.9          .      97.9     97.9
racehispan            94.6          .      94.6     94.6
racewhite             96.8          .      96.8     96.8
nodegree              75.7          .      75.7     75.7
married               87.5          .      87.5     87.5
re74                  79.0        4.6      74.9     52.6
re75                  46.8    -1474.9      67.6     62.4

Sample Sizes:
              Control Treated
All            429.       185
Matched (ESS)  131.78     111
Matched        146.       111
Unmatched      283.        74
Discarded        0.         0

> 
> # Optimal full PS matching for the ATE within calipers on
> # PS, age, and educ
> 
> m.out4 <- matchit(treat ~ age + educ + race + nodegree +
+                    married + re74 + re75, data = lalonde,
+                    method = "full", estimand = "ATE",
+                    caliper = c(.1, age = 2, educ = 1),
+                    std.caliper = c(TRUE, FALSE, FALSE))
Error: Package 'optmatch' is needed for this function to work. Please install it.
Execution halted