Announcement

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

  • How to match randomized treatment (not in order) to round (in order)?

    Dear Statalist,

    I have a randomized order of treatments in four rounds. Rounds 1-4 are always in order, but the treatments are not.

    I would like to 1) understand the ordering, i.e., how often was treatment 1 in round 1, in round 2, in round 3, and 4 and so on with the remaining 3 treatments.

    I thought of using count if:
    Code:
     count if treatment == 1 == round ==1
    and so on but I hope there is a more elegant way to present the data in a table.

    2) I would like to use this information of order and treatment in my regression as an independent variable. Would I use i.round##i.treatment for that?

    Here is an excerpt of the data using dataex:

    Code:
     dataex round treatment
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input byte(round treatment)
    1 2
    2 3
    3 1
    4 4
    1 1
    2 3
    3 4
    4 2
    1 4
    2 3
    3 2
    4 1
    1 1
    2 4
    3 2
    4 3
    1 3
    2 4
    3 1
    4 2
    end

    Thank you very much in advance!

    Kind regards,
    Scott

  • #2
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input byte(round treatment)
    1 2
    2 3
    3 1
    4 4
    1 1
    2 3
    3 4
    4 2
    1 4
    2 3
    3 2
    4 1
    1 1
    2 4
    3 2
    4 3
    1 3
    2 4
    3 1
    4 2
    end
    
    table treatment round, stat(count round)
    Res.:

    Code:
    . table treatment round, stat(count round)
    
    ----------------------------------
              |          round        
              |  1   2   3   4   Total
    ----------+-----------------------
    treatment |                       
      1       |  2       2   1       5
      2       |  1       2   2       5
      3       |  1   3       1       5
      4       |  1   2   1   1       5
      Total   |  5   5   5   5      20
    ----------------------------------
    Would I use i.round##i.treatment
    You would do that if you wanted to see whether there was an effect of treatment, round and whether these effects interact.

    Comment


    • #3
      Thank you very much! You have been most helpful!

      Comment

      Working...
      X