You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See demo script, below. matchit() fails in first call. Adding rownames fixes it in second call. This is due to some extraction breaking deep in the guts of matchit()
Small test case of possible bug?
library( MatchIt )
make.dat = function( p, N, beta0 = -1, beta1=1 ) {
X = matrix( rnorm( p * N ), ncol = p )
pi = arm::invlogit( beta0 + beta1 * X[,1] )
Z = 0 +( runif( N ) <= pi )
colnames(X) = paste( "X", 1:p, sep="" )
df = as.data.frame( X )
df$Z = Z
df
See demo script, below. matchit() fails in first call. Adding rownames fixes it in second call. This is due to some extraction breaking deep in the guts of matchit()
Small test case of possible bug?
library( MatchIt )
make.dat = function( p, N, beta0 = -1, beta1=1 ) {
X = matrix( rnorm( p * N ), ncol = p )
pi = arm::invlogit( beta0 + beta1 * X[,1] )
Z = 0 +( runif( N ) <= pi )
}
mydat = make.dat( 3, 100 )
head( mydat )
str( mydat )
m.out <- matchit(Z ~ X1 + X2 + X3, data = mydat, method = "nearest",
caliper = 0.2, mahvars = c("X1","X2") )
rownames( mydat ) = paste( "R", rownames(mydat), sep="" )
m.out <- matchit(Z ~ X1 + X2 + X3, data = mydat, method = "nearest",
caliper = 0.2, mahvars = c("X1","X2") )
The text was updated successfully, but these errors were encountered: