Hi all, I am designing a study in which I am selecting a subset of college courses to be randomly assigned to one of two conditions. I would like to create matched pairs of courses, and then randomly assign them to condition within each pair. I would like to identify, for each course, the one that best matches it, and quantify how well it matches. Here is a much simpler data set for purposes of illustration:
ED <- data.frame(course = letters[1:5], level=factor(c(100, 100, 200, 300, 200)), size = c(44, 12, 23, 124, 30), rating = c(4,5,5,3,5)) > > course level size rating 1 a 100 44 4 2 b 100 12 5 3 c 200 23 5 4 d 300 124 3 5 e 200 30 5 Basically I want a function that tells me that courses c and e "match" so that I can treat them as a pair and randomly assign them to condition. I've looked at the matching and MatchIt packages, but they seem to need to know in advance which course is in the treatment condition and which is in the control condition. I'll be grateful for any suggestions. Best, -- Ista Zahn Graduate student University of Rochester Department of Clinical and Social Psychology http://yourpsyche.org ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.