javascript - Adaptive Randomization Algorithm -


gist:

i'm looking randomization algorithm can each subject, @ previous measurements, determine if subject fall high or low end, ensure approximately half of each of these groups assigned experimental condition.

details:

i'm building research application has 2 independent variables. 1 experimental manipulation can assign. we'll call these x (experimental) , c (control). other personal characteristic 2 categorical types, measured through scale. we'll call these p1 (type 1) , p2 (type 2).

so it's 2x2 have 4 conditions (p1x, p1c, p2x, p2c). i'm recruiting 120 subjects ideally i'd have distribution of 30 subjects in each condition.

i have 3 problems.

1) based on literature i'm expecting natural 50/50 split between p1 , p2 characteristics in sample. however, can't sure population isn't i'd consider general population split estimate derived from.

2) simple randomization of x or c manipulation won't guarantee equal distribution. exacerbates first problem if see e.g. p1 40% , p2 60% split, 50% (x or c) of 48 leaves me 24 people. of course, worse. if random assignment of experimental manipulation ends less 50% smaller sub-sample, again, worse. fear left small sample run analyses.

3) complication categories, p1 , p2 less definitive , more relative. we'd split p1 , p2 via median. determined on aggregate value of several scale measurements (total range 0-20). however, in sample might see bias toward 1 end. in case, might have relative comparison. in case, don't know median lie split sample. whatever median becomes, like, "these people more p1 p2" or vice versa. don't know average or sd sample.

what can in experiment:

what can measure people's p1/p2 types before assigning them either x or c. can't pre-test before assignment i'll know bigger picture 1 subject @ time until stabilizes enough sample.

question:

so question in short is, there randomization algorithm can adapt these unknowns know more 1 experiment next?

basically want measure subject's p1/p2 measure, compare against entire sample point , find out if more or less in upper-half toward p2 or lower-half toward p1. after figure out, want assign them either x or c in way ensures better simple random i'll equal number of participants in each condition.

i'm not sure if right place ask, maybe stack cross-validated? anyway, ahead of time if have suggestions.

extra note:

the application programmed in javascript.

first trick, you'll need priority queue. google gives me https://github.com/adamhooper/js-priority-queue javascript. need two. 1 give smallest in p2, , other give largest in p1.

with done, need keep 4 counters 4 groups.

the first person randomly assigned control or experimental. second assigned other, 2 assigned p1 , p2. initialize counters 1's , 0's.

with each subsequent person encounter, compare them largest in p2, smallest in p1, , decide group go in , whether need move between groups. if need move someone, , update counters. assign them treatment or control based on less common in pi in, breaking ties less common in other pi, breaking further ties randomly.

this not guarantee split, make faith effort generate one.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -