+ Reply to Thread
Results 1 to 8 of 8

Thread: How to calculate how often a specific combination occurs in random design?

  1. #1
    Points: 120, Level: 2
    Level completed: 40%, Points required for next Level: 30

    Posts
    14
    Thanks
    5
    Thanked 1 Time in 1 Post

    How to calculate how often a specific combination occurs in random design?




    Hi everybody,

    I hope someone can help me out! We designed an experiment in which 24 short clips are shown to particpants. These clips belong to four different categories (so we have 6 clips per categorie). Let's call the categories A, B, C and D. Each participants gets to see all 24 clips in random order without replacement.

    Since I am particularly interested in the effects if a C clip is shown after a B clip I would like to know (1) for how many participants we can expect that at least two times a C clip is shown directly after a B clip; and (2) what the expected average times of a C clip being shown after a B clip per person is.

    We hope for 3000 participants in total.

    I would like to do these kinds of calculations myself so I hope someone can explain to me what the steps are. Thanks!

  2. #2
    Omega Contributor
    Points: 38,334, Level: 100
    Level completed: 0%, Points required for next Level: 0
    hlsmith's Avatar
    Location
    Not Ames, IA
    Posts
    6,998
    Thanks
    398
    Thanked 1,186 Times in 1,147 Posts

    Re: How to calculate how often a specific combination occurs in random design?

    So you have not conducted the experiment yet? You randomized the order of clips for each person or just once? If you randomized the clips with a randomization algorithm you should be fine? So I am not understanding your question.

  3. #3
    Points: 120, Level: 2
    Level completed: 40%, Points required for next Level: 30

    Posts
    14
    Thanks
    5
    Thanked 1 Time in 1 Post

    Re: How to calculate how often a specific combination occurs in random design?

    Thanks for your reply. We are conducting the experiment right now. We randomized the order of the clips for each person separately and indeed randomized the clips with a randomization algoritm. When the experiment was designed we did not know that the effects of clip C shown after clip B would be most interesting to us and thereofre we did not put restrictions to the randomization method to guarantee sufficient cases of C being shown after B. Right know I would like to make an estimation whether if we go on like this we will end up with a sufficient number or not. That's the background of my questions (1) for how many participants we can expect that at least two times a C clip is shown directly after a B clip; and (2) what the expected average times of a C clip being shown after a B clip per person is.

  4. #4
    Omega Contributor
    Points: 38,334, Level: 100
    Level completed: 0%, Points required for next Level: 0
    hlsmith's Avatar
    Location
    Not Ames, IA
    Posts
    6,998
    Thanks
    398
    Thanked 1,186 Times in 1,147 Posts

    Re: How to calculate how often a specific combination occurs in random design?

    Is it block design, so it randomizes A, B, C, D, then does it again? So it is not possible for a B then B ordering?

  5. #5
    Points: 120, Level: 2
    Level completed: 40%, Points required for next Level: 30

    Posts
    14
    Thanks
    5
    Thanked 1 Time in 1 Post

    Re: How to calculate how often a specific combination occurs in random design?

    No, B then B is also possible. So no block design.

  6. #6
    Devorador de queso
    Points: 95,814, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Posting AwardCommunity AwardDiscussion EnderFrequent Poster
    Dason's Avatar
    Location
    Tampa, FL
    Posts
    12,935
    Thanks
    307
    Thanked 2,629 Times in 2,245 Posts

    Re: How to calculate how often a specific combination occurs in random design?

    On average you can expect about 1.5 observations of "C directly follows B" per participant. There is approximately a 48% chance that a participant will have 2 or more cases where C directly follows B. I was too lazy to do the math so I just simulated it.
    I don't have emotions and sometimes that makes me very sad.

  7. The Following User Says Thank You to Dason For This Useful Post:

    Funmath (09-11-2015)

  8. #7
    Points: 120, Level: 2
    Level completed: 40%, Points required for next Level: 30

    Posts
    14
    Thanks
    5
    Thanked 1 Time in 1 Post

    Re: How to calculate how often a specific combination occurs in random design?

    Quote Originally Posted by Dason View Post
    On average you can expect about 1.5 observations of "C directly follows B" per participant. There is approximately a 48% chance that a participant will have 2 or more cases where C directly follows B. I was too lazy to do the math so I just simulated it.
    Thanks! Did you by any chance simulate it in R? In that case, could you send me the code?

    I am still interested in knowing how to calculate this by the way, so if anyone is willing to do so I would greatly appreciate it!

  9. #8
    Devorador de queso
    Points: 95,814, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Posting AwardCommunity AwardDiscussion EnderFrequent Poster
    Dason's Avatar
    Location
    Tampa, FL
    Posts
    12,935
    Thanks
    307
    Thanked 2,629 Times in 2,245 Posts

    Re: How to calculate how often a specific combination occurs in random design?


    I did use R. I used a throwaway script and it wasn't too efficient but it got the job done. Basically I did something like...

    Code: 
    vals <- rep(LETTERS[1:4], 6)
    
    cfollowsb <- function(x){
      # this should return how many times C follows B in the input vector
      # This is off the top of my head but it was something like...
      sum(outer(which(x == "B"), which(x == "C"), "-") == -1)
    }
    
    sim <- replicate(1000, cfollowsb(sample(vals)))
    mean(sim)
    mean(sim >= 2)
    I don't have emotions and sometimes that makes me very sad.

  10. The Following User Says Thank You to Dason For This Useful Post:

    Funmath (09-11-2015)

+ Reply to Thread

           




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts






Advertise on Talk Stats