Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Sampling without replacement

I'm programming an OSpan task and want to sample without replacement. My block loop has the variables: 'equation', 'letter', and 'correct_response'. My trial sequence consists of a sketchpad presenting the [equation] stimuli, and then another sketchpad afterwards presenting the [letter] stimuli. The trial sequence will be called however many letters long I want the letter string (that the participant is trying to memorize in between math equations) to be. However, when the trial sequence is recalled, there's the possibility of getting the same math equation or same letter in that one letter string "trial", which I don't want. How can I get it to be called randomly but without replacement?

Comments

  • Hi Morgan,

    The structure of your experiment is not really clear to me. Could you upload it (you can attach it to a comment) so I can take a look?

    Cheers,
    Sebastiaan

  • How do I upload an .osexp file into the comments? I'm only seeing an external link for URL and image URL? Or did you want the general script of the experiment?

  • You can just upload it by selecting an osexp file instead of an image through the attachment dialog (which, I admit, is a bit confusing).

  • I've checked on both a PC and Mac, and 3 different web browsers and I'm not able to get a file upload through the attachment dialog. They all strictly offer an Image URL attachment. Maybe it's a function that got lost in the US version of the website? I'm not sure!

  • Oops, it was a permission issue: Regular members weren't allowed to upload files. You should be able to upload the experiment now.

  • I'm specifically looking for a way to have no replacement when I'm sampling from the tables (like the one I screenshot). I don't want any of the equations or letters to be repeated while doing one letter sequence. For example, the 2_Loop is a loop that creates a 2 letter sequence OSpan, where the participant is shown an equation, then a letter, then another equation, then another letter, and finally has to recall the 2 letters in the correct order. Within that 2 letter sequence, I don't want there to be a repeated equation or a repeated letter, but I can't figure out a way to do that.

  • edited August 2016

    Hi Morgan,

    I don't think you can make your experiment with relying only on the loop tables, at least not in an easy way. I recommend you select the trials to run from within an inline_script. This requires that you have your variables stored in some data container. As all three (equation, correct_response, and letter) belong together, it makes sense to store them in a dictionary, e.g. trial_one = dict(equation='1+4 =5',cor_resp = 'left',letter='F'). However, if you could also just have three separate lists, and use the same indices to operate on them. This should also make sure that you don't mix them up. Here some code that selects two trials with the restrictions you mentioned.

    import random
    
    # a list with all your equations (I use only 4, for brevity)
    equations = ['1+4=5','1+5=7','3+6=8','2+4=5']
    # same for correct_response and letter. Make sure you don't mess up the order!
    correct_response = ['left','right','left','right']
    letter = ['F','G','F','G']
    
    # choose the first equation and letter
    idx1 = random.choice(range(len(equations)))
    eq1 = equations[idx1]
    let1 = letter[idx1]
    
    # Keep on sampling the 2nd equation and letter as long as either matches the first equivalent
    # once both letters and equations are unique, set the correct_response and break the loop
    while True:
        idx2 = random.choice(range(len(equations)))
        eq2 = equations[idx2]
        let2 = letter[idx2]
        if let2 != let1 and eq1 != eq2:
            cr1 = correct_response[idx1]
            cr2 = correct_response[idx2]
            break
    

    I hope this is useful.

    Good luck,

    Eduard

    Buy Me A Coffee

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games