Hi.
Each time I use a matchit package, the results of conditional logistic regression are different.
Is it right?
df.final = as.data.frame(na.omit(df))
opt.psm.out4 = matchit(treat~ gr_age+sex+dx_htn+dx_dm+dx_ckd+gr_cci, method = "nearest", data = df.final, ratio=3)
opt.data4 = match.data(opt.psm.out4)
match.matrix<-opt.psm.out4[["match.matrix"]]
#Getting strata from nearest neighbor matching
opt.data4$subclass <- vapply(rownames(opt.data4), function(x) {
out <- which(rownames(match.matrix) == x | apply(match.matrix, 1, function(y) x %in% y))
if (length(out) == 0) out <- NA_integer_
out
}, integer(1L))
cbind(table(opt.data4$subclass ))