Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Manipulating the Experimental Economics Data

    Hello everyone, I have a problem that needs to be solved, and I hope I can get any help here.

    I have an experimental economics data that my lecturer ran, and the data sample of one of the individuals that participated in this experiment is given below:
    Click image for larger version

Name:	Untitled.png
Views:	1
Size:	20.5 KB
ID:	1662900






    Here is the context:
    The experiment ran in 20 rounds where each participant got five tokens in each round that should be allocated between the five alternatives shown on the participant's page. The alternative contains information about the participant's payoffs if they choose it. I have 21 alternatives that were randomly selected in each round into five alternatives. For example, in Round 1, Jack faces five alternatives: Alternatives 5,3,10,19, and 21, where each alternative contains information that he would get either x1 with a probability of p1 or x2 with a probability of p2 (note: r1_ r2_, etc. means experiment rounds). He decided to allocate five tokens into different alternatives (stored in "r1lotere" variable). After he allocates his tokens and finishes that round, he will get information about the payoff shown in the alternatives he chose in that Round (stored in "r1_reveal" variable). The experiment will continue until Round 20, which shows different alternatives in each round since it is randomly chosen and not ordered. It does not rule out the possibility that Jack faces the same alternatives in two or more rounds since it has a total of 20 rounds. In the next round, if Jack faces one or several same alternatives shown in previous rounds that he faced before and decides to allocate it (for example, Jack faces Alternative_5 in Round 1 and allocates his tokens to Alternative_5, he got the information right after the Round 1 that he got x1 (that is 21) and he faces Alternative_5 again in Round 10, 13, and 17), then the information in Alternative_5 in Round 10,13, and 17 should change in a certain value, not in the probabilistic form again since the payoff is already revealed in the previous round (that is 21 in Round 1). Meaning that the x1, p1, x2, and p2 in Round 10, 13, and 17 of Alternative_5 should change to x1 = 21, p1 = 1, x2 = 0, p2 = 0. However, this is not happening in my dataset right now. Hence, I have to manipulate it manually into that condition to all possible Alternatives shown in two or more rounds that have been allocated before. How do I code this situation to manipulate the data?

    Additional note: the x1, p1, x2, and x2 will only change to a certain value if and only if the same Alternative is already shown in previous Rounds that Jack took and managed to allocate it. This means that, for example, if Alternative_13 were shown in Round 2, 9, 13, and 17, and he just started to allocate his token to Alternative_13 in Round 13, then the x1, p1, x2, and p2 in Round 2, 9 and, 13 will still in probabilistic form, and will change to certain value only in Round 17 because he just started to allocate his token to Alternative_13 in Round 13, even though Jack is not allocating his token to Alternative_13 in Round 17.

    Thank you for helping me, and sorry for the long explanation and if it's confusing.
    Last edited by Muhammad Rafi Prakoso; 03 May 2022, 21:52.

  • #2
    Up upp

    Comment


    • #3
      Muhammad:
      unsolicited advice: too long a query, Please try to slim it down following the FAQ. Thanks.
      Kind regards,
      Carlo
      (StataNow 18.5)

      Comment


      • #4
        Aside from its length, I don't get what the problem is or how there's a Stata solution to whatever the problem might be. I just see a long list of Booleans and conditions with no obvious relevance to Stata. As Carlo said, please read the FAQ to learn how to ask a question

        Comment


        • #5
          Hello Carlo & Jared, thank you for the advice and sorry for the incompatibility with the FAQ. Since I can't edit my first post anymore, here is a more concise explanation with an example of what I have tried to resolve this issue.

          I have experimental economics data that contains approximately 120 columns. The experiment runs in 20 rounds, and each round consists of 5 alternatives decision that the participant can choose through the allocation of tokens in each round. The game itself has 21 randomly selected alternatives in each round so that every individual will face different options in each round.

          All of the alternatives are a probabilistic form that will be revealed their value if the participants decided to allocate their tokens to the alternative. After the value is revealed, if the same alternative is shown again in another round, it should be at a certain value that was revealed before. So, I tried to manipulate the data with this:
          Code:
          local str = 1
          forval sto = 2/20{
          while r`sto'_displayed_lotteries == r`str'_displayed_lotteries {
          replace r`sto'_x2 = 0 if r`str'_reveal == r`str'_x1
          replace r`sto'_p2 = 0 if r`str'_reveal == r`str'_x1
          replace r`sto'_p1 = 1 if r`str'_reveal == r`str'_x1
          replace r`sto'_x1 = 0 if r`str'_reveal == r`str'_x1
          replace r`sto'_p1 = 0 if r`str'_reveal == r`str'_x1
          replace r`sto'_p2 = 1 if r`str'_reveal == r`str'_x1
          }
          local str = `str' + 1
          }
          What I try to do with the code is whenever the alternative is displayed and is chosen in a particular round, then all remaining round that contains the same alternative should be displayed in an exact value that was revealed before. However, it seems like this command only works if the same alternative is shown within one different round only, not for all of the remaining rounds.

          In addition, since all of the alternatives in each round are displayed randomly and not ordered, the variable will only change if the same alternative is in the same row and doesn't work for a case where the same alternative is on a different row. Until now, I am still figuring out how to solve these two issues.
          Last edited by Muhammad Rafi Prakoso; 04 May 2022, 07:43.

          Comment

          Working...
          X