ich möchte ein Matching mit der Nearest-Neigbour-Methode durchführen und speziell eine Variable (Geschlecht) exakt matchen.
Das ist mein Befehl:
Code: Alles auswählen
match.it <- matchit(Patienten~Alter+Sex+BMI+Alkohol+Nikotin,data=df,method="nearest",m.order="smallest",ratio=1,exact="Sex")
Jemand eine Idee, woran das liegen kann? Vielen DankError in Ops.data.frame(exact[itert, k], exact[clabels, k]) :
‘!=’ only defined for equally-sized data frames
In addition: Warning message:
In matchit2nearest(c(`1` = 1, `2` = 1, `3` = 1, `4` = 1, `5` = 1, :
Fewer control than treated units and matching without replacement. Not all treated units will receive a match. Treated units will be matched in the order specified by m.order: smallest
Liebe Grüße
Lis