
R Under development (unstable) (2020-02-05 r77773) -- "Unsuffered Consequences"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> suppressMessages(library(Matching))
> suppressWarnings(RNGversion("3.5.3"))
> 
> data(lalonde)
> 
> X  <- cbind(lalonde$black, lalonde$age, lalonde$educ)
> Y  <- lalonde$re78
> Tr  <- lalonde$treat
> 
> rr2  <- Matchby(Y=Y, Tr=Tr, X=X, M=1, exact=TRUE, by=X[,1],
+                 ties=TRUE, replace=TRUE, AI=TRUE)
1 of 2 groups
2 of 2 groups
> summary(rr2)

Estimate...  1907.3 
AI SE......  598.06 
AI T-stat..  3.1891 
AI p.val...  0.0014269 

SE.........  863.19 
T-stat.....  2.2096 
p.val......  0.027133 

Original number of observations..............  445 
Original number of treated obs...............  185 
Matched number of observations...............  119 
Matched number of observations  (unweighted).  355 

Number of treated observations dropped.......  66 

> 
> rr  <- Match(Y=Y, Tr=Tr, X=X, M=1, exact=TRUE)
> summary(rr, full=TRUE)

Estimate...  1907.3 
AI SE......  598.06 
T-stat.....  3.1891 
p.val......  0.0014269 

Est noAdj..  1907.3 
SE.........  863.19 
T-stat.....  2.2096 
p.val......  0.027133 

Original number of observations..............  445 
Original number of treated obs...............  185 
Matched number of observations...............  119 
Matched number of observations  (unweighted).  355 

Number of obs dropped by 'exact' or 'caliper'  66 

> 
> abs(rr$est-rr2$est) < 1e-10
     [,1]
[1,] TRUE
> abs(rr$se-rr2$se) < 1e-10
[1] TRUE
> abs(rr$se.standard-rr2$se.standard) < 1e-10
[1] TRUE
> 
> proc.time()
   user  system elapsed 
  0.260   0.180   0.857 
