1
$\begingroup$

This seems like it should be an easy problem to solve, but I can't think of anything nor can I find anything to help me. I'm working with multiple data sets where I have a series of sometimes correlated, but usually not, variables. I want to select individuals from this large population for further experimental study that vary for one measurement but are as similar as possible for all other variables.

I have anywhere from 300-700 individual observations with 8-24 variables that I want to control for. The subset size will vary, though I'd like a minimum of 8 (at either end) and a max of 20.

Sample data (R):

head(df)
  id   height       LN     RPct FT
1 a1 61.39265 36.14031 1.794545 66
2 b1 56.09371 19.98055 2.216522 65
3 c1 24.68878 27.92030 1.920440 41
4 d1 45.08929 50.53640 2.359136 22
5 e1 43.50179 21.10336 1.650292 63
6 a2 46.78293 48.14680 2.204851 83

I would want to (for example) select individuals that vary the most for FT but are not different for height, LN, and RPct (full data dput at end).

I could do this through iterative ranking and testing, but I am trying to find a way to do it so that it can be reproduced. Any suggestions as to a best method? Regression (like this)? Some sort of PCA?

Example data frame:

structure(list(id = structure(c(1L, 21L, 41L, 61L, 81L, 12L, 
32L, 52L, 72L, 92L, 14L, 34L, 54L, 74L, 94L, 15L, 35L, 55L, 75L, 
95L, 16L, 36L, 56L, 76L, 96L, 17L, 37L, 57L, 77L, 97L, 18L, 38L, 
58L, 78L, 98L, 19L, 39L, 59L, 79L, 99L, 20L, 40L, 60L, 80L, 100L, 
2L, 22L, 42L, 62L, 82L, 3L, 23L, 43L, 63L, 83L, 4L, 24L, 44L, 
64L, 84L, 5L, 25L, 45L, 65L, 85L, 6L, 26L, 46L, 66L, 86L, 7L, 
27L, 47L, 67L, 87L, 8L, 28L, 48L, 68L, 88L, 9L, 29L, 49L, 69L, 
89L, 10L, 30L, 50L, 70L, 90L, 11L, 31L, 51L, 71L, 91L, 13L, 33L, 
53L, 73L, 93L), .Label = c("a1", "a10", "a11", "a12", "a13", 
"a14", "a15", "a16", "a17", "a18", "a19", "a2", "a20", "a3", 
"a4", "a5", "a6", "a7", "a8", "a9", "b1", "b10", "b11", "b12", 
"b13", "b14", "b15", "b16", "b17", "b18", "b19", "b2", "b20", 
"b3", "b4", "b5", "b6", "b7", "b8", "b9", "c1", "c10", "c11", 
"c12", "c13", "c14", "c15", "c16", "c17", "c18", "c19", "c2", 
"c20", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "d1", "d10", 
"d11", "d12", "d13", "d14", "d15", "d16", "d17", "d18", "d19", 
"d2", "d20", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "e1", 
"e10", "e11", "e12", "e13", "e14", "e15", "e16", "e17", "e18", 
"e19", "e2", "e20", "e3", "e4", "e5", "e6", "e7", "e8", "e9"), class = "factor"), 
    height = c(61.3926499213514, 56.0937120819672, 24.6887806108659, 
    45.0892865852733, 43.5017891607347, 46.7829272699527, 50.6302309049612, 
    52.6993891711301, 38.7903345176214, 47.4212681506714, 48.6378256869271, 
    59.0381035770842, 43.4004569136153, 64.2739857885888, 63.0952884051312, 
    30.8770659812272, 64.6585516491084, 51.0461763649416, 55.5916182765318, 
    57.9359586313794, 42.8065406760089, 60.1546551663377, 41.0550394885569, 
    48.5078219872331, 55.1017156549783, 56.5788858493376, 36.9612956783, 
    41.5272736881429, 38.3636800762774, 49.8996282966354, 54.0949023127965, 
    53.3160197216756, 63.5524691546445, 60.0777131542094, 55.9628321387463, 
    50.3791996504271, 49.6396096170447, 41.9520768278872, 43.3538937198281, 
    59.9403102521549, 52.0452538920431, 40.3699290919021, 52.7849484166514, 
    49.7808027431486, 49.3661268217219, 44.0334262584858, 45.5660592429196, 
    65.6409846103953, 52.4727587684906, 43.7443430388867, 49.621943158656, 
    47.6684363163508, 55.2339272589273, 59.4509287642827, 58.314848179888, 
    46.8368179098762, 66.2182753932084, 56.7100407682605, 64.895620698773, 
    68.696750049795, 50.7500394492059, 66.805712629772, 49.471790458698, 
    48.7975171042571, 75.715941540804, 59.5802622895758, 41.4796280876525, 
    53.1086955597671, 53.4769061058228, 35.4329283438649, 32.9435182273555, 
    44.3654486754547, 47.4172243831034, 59.7416210802606, 43.0201059521514, 
    59.8569900288559, 42.5027317724262, 51.1804131685383, 54.2489889125727, 
    40.4744522689002, 36.3386976683988, 38.6381730848658, 50.392228186581, 
    36.8570397412192, 48.2632845389417, 58.2117412494924, 69.3293667124402, 
    44.0158250661498, 63.1886085698037, 44.0652824850441, 46.8510534254706, 
    53.2554306795893, 60.7625277424255, 38.8434889759179, 35.4429322929479, 
    63.1364019145398, 62.8110739938786, 65.9879917511603, 55.2008537053251, 
    43.391513852912), LN = c(36.1403128347872, 19.9805493684969, 
    27.9202952150689, 50.5363991507364, 21.1033555280914, 48.1467989996265, 
    21.7938335342454, 23.9055278665816, 14.8381293406192, 18.3286547214051, 
    21.0279316421736, 29.5241112825903, 14.8673426662504, 26.7261691335993, 
    24.3167617651284, 24.4118673622224, 14.6871399150311, 16.4774392898825, 
    37.6924561052253, 21.1246038573398, 9.98961506472234, 31.0774033360875, 
    24.842764380461, 13.2423818760388, 23.3345713836714, 35.4154106025064, 
    24.7001126910814, 29.2240682960212, 29.7418409808088, 22.5880053208487, 
    27.0171019709991, 20.3177662580696, 30.7089566021765, 24.3164504785525, 
    34.0971598644573, 22.9019866868406, 25.1975499340761, 18.4456504325228, 
    28.5514001536969, 11.9886769775439, 37.6663146829622, 30.2183767613021, 
    25.3493190529559, 27.6031770605841, 19.5996736816471, 19.026983284323, 
    17.5701517600455, 14.4974205038756, 22.91908831138, 24.691460223656, 
    23.9078430461268, 2.51605712806504, 35.3978599084645, 14.2680934972458, 
    26.0386180782028, 17.7401371869453, 23.3105884191406, 32.3373786376902, 
    7.49097250311568, 18.9813852128619, 25.3596546023439, 25.9220787364843, 
    12.070531862143, 17.5824027340891, 29.979242168039, 17.9346512799747, 
    21.6922900142135, 25.7346310990904, 42.4087581119448, 19.1252060692027, 
    29.7936500183087, 25.8668655929755, 27.929929775861, 31.3061177456, 
    25.4817335703646, 24.1467106017957, 17.1926518705504, 35.8980820824959, 
    16.8990531522121, 35.6670143787931, 30.7823184702734, 16.9258168757825, 
    24.6241919079886, 5.42476652577392, 14.838443387176, 25.4634744048817, 
    30.0207802250151, 23.5505382163145, 13.033228819183, 15.2617992976743, 
    33.7956195044926, 16.995130860583, 33.457040991836, 19.5884111391063, 
    8.49874122430124, 16.7730993991857, 33.8860826997225, 31.3664933205887, 
    7.69512934651184, 25.0322389480912), RPct = c(1.79454530857189, 
    2.21652220209668, 1.92044019675252, 2.3591358877179, 1.65029193229594, 
    2.2048509061064, 2.04321858442935, 1.89659558821996, 1.97197554511446, 
    2.04318967115881, 1.87260041107233, 1.84797311649956, 1.7498867697617, 
    1.90776634073853, 2.06528540753599, 1.39521311276524, 1.80944414624515, 
    1.87448361472491, 1.93788380808347, 1.64101544055008, 1.66249048805557, 
    2.58318995409362, 1.81594162467797, 1.42276960928137, 2.04984372222634, 
    1.85266782894256, 1.93833666146652, 2.15548026371359, 2.27959982110782, 
    1.91987473934299, 1.82547163181708, 2.3923323770094, 1.60807530711615, 
    2.33460894921163, 2.12619081463062, 2.25715606382167, 2.11264515795701, 
    2.35389555963615, 2.58344023871013, 1.83325610631623, 2.22214193269315, 
    2.06047539128528, 2.34473588742745, 1.7477013739375, 2.06285904024168, 
    1.6043384303865, 2.32505498335946, 1.85204123109702, 1.93346564270812, 
    1.85386384472073, 2.54712141512475, 2.22991966962988, 2.62992645305548, 
    2.23808528168464, 1.91989698350557, 2.20072785145783, 1.82454661744663, 
    1.73008015647733, 1.80961666488415, 1.75704259557251, 1.43411908918252, 
    2.4503494093366, 1.76209710683235, 1.90249534625937, 1.56402103940356, 
    2.15121340768017, 1.81067818240885, 2.65246148368806, 1.34731556129446, 
    2.19084344461716, 1.24110591377516, 1.89070778513928, 1.10103463656105, 
    1.87419627303558, 1.93228212616538, 2.46264951601124, 1.9838711246603, 
    2.10819860279592, 1.76881143203697, 2.45621709859937, 1.76636559968593, 
    2.34495924465785, 1.90287134739317, 1.87515540439016, 2.03255080452851, 
    1.90857763608263, 1.9350663491604, 2.23992318289473, 2.07950960323367, 
    1.93473445304474, 1.34754151270066, 1.64146766042946, 1.92584521856364, 
    2.05128334952478, 1.99409179027597, 1.85272491464028, 1.82370442287739, 
    1.89374824900063, 2.33548483943392, 1.97862789849689), FT = c(66, 
    65, 41, 22, 63, 83, 50, 64, 59, 43, 62, 62, 62, 60, 31, 91, 
    46, 77, 75, 75, 50, 83, 83, 73, 87, 76, 51, 64, 68, 56, 47, 
    57, 58, 53, 61, 67, 59, 92, 93, 31, 75, 76, 56, 66, 81, 67, 
    69, 74, 55, 73, 72, 31, 87, 62, 91, 102, 100, 68, 38, 87, 
    66, 114, 78, 89, 82, 59, 59, 48, 71, 45, 81, 72, 91, 38, 
    79, 50, 62, 61, 76, 65, 98, 79, 46, 86, 87, 70, 51, 65, 48, 
    53, 100, 66, 74, 37, 71, 95, 79, 106, 73, 80)), .Names = c("id", 
"height", "LN", "RPct", "FT"), row.names = c(NA, -100L), class = "data.frame")
$\endgroup$
1
  • $\begingroup$ This seems more like a question about methodology than software, so should be left open. $\endgroup$ Sep 10, 2015 at 11:14

0

Browse other questions tagged or ask your own question.