Running examples in ‘nearfar-Ex.R’ failed
The error most likely occurred in:

> ### Name: opt.nearfar
> ### Title: Finds optimal near-far match
> ### Aliases: opt.nearfar
> 
> ### ** Examples
> 
> #Generate data
> set.seed(81)
> dta = mvrnorm(100,c(10,10,10),matrix(c(1,-0.5,0.5,-0.5,1,0.5,0.5,0.5,1),3,3))
> Zstar = dta[,1] #Part of Z that is correlated with unmeas conf
> X.unmeas = dta[,2] #Unmeas conf
> X.meas = dta[,3] #Meas conf
> IV = rnorm(100,10,1) #Instrumental variable
> Z = 1+5*Zstar+3*X.meas+1*IV+rnorm(100,0,10) #Observed treatment
> Y = 1+1*Z+1*X.meas+5*X.unmeas+rnorm(100,0,20) #Outcome
> df.sim = data.frame(Y=Y,Z=Z,IV=IV,X=X.meas) #set up for near-far match 
> #(X is measured confounder)
> 
> #Execute near-far match (just for illustration)
> #The default setting is max.time.seconds=300
> nf = opt.nearfar(dta=df.sim,trt.bin=FALSE,imp.var=NA,tol.var=NA,
+     adjust.IV=TRUE,max.time.seconds=3)
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1]  1 16
[1] 1080
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1]  5 11
[1] 2410
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1]  8 96
[1] 250
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 27 76
[1] -170
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 34 49
[1] 720
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 37 60
[1] 980
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 43 98
[1] 4060
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 48 93
[1] 340
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 85 88
[1] 1170
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 86 46
[1] -1640
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 28 80
[1] 1835
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 70 82
[1] 3940
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 45 56
[1] 4360
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 39 33
[1] 4580
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 71 63
[1] 2440
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 69 53
[1] 5730
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1]  6 59
[1] -350
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 47 40
[1] 3060
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 20 79
[1] 2200
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 64 67
[1] -220
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 75 38
[1] 1820
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 74 15
[1] 3370
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 57 65
[1] 4050
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 17 21
[1] 3960
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 73  9
[1] 1680
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 35 22
[1] 1860
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 29 50
[1] 1900
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1]  4 68
[1] 1230
0ERROR , THE OPTIMALITY CONDITIONS ARE VIOLATED AT EDGE
[1] 51 84
[1] 2140