Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
en:create:random_urns [09.01.2015 15:38] adminen:create:random_urns [04.06.2019 21:25] – [Randomization Using Urns] admin
Line 4: Line 4:
  
 The chapter describes step by step how to create an urn and how to draw a ballot (e.g. a random number) out of the urn. The chapter [[randomization|randomization]] describes how the ballot drawn is used in randomization. The chapter describes step by step how to create an urn and how to draw a ballot (e.g. a random number) out of the urn. The chapter [[randomization|randomization]] describes how the ballot drawn is used in randomization.
 +
 +**Important:** A [[:en:create:questions:random]] is more appropritate than urns for most use cases. If your goal is to "just" sort respondents into experimental groups, and present questions, images or texts to them, then please read [[:en:create:randomization]].
 +
 +**Important:** Urns are the best solution only for very few special ue cases. Please 
 +en sind nur für wenige spezielle Anwendungsfälle die beste Lösung. lease be sure to read the chapter on [[:en:create:randomization]], __before__continue reading here (if that should be necessary at all then).
 +==== Drawing without Replacement ====
 +
 +A random draw "without replacement" can be likened to a draw from a lottery wheel ("urn"). The use of urns in SoSci Survey (like the the [[:de:create:questions:random]]) guarantees experimental groups of the same size. In the context of conjoint analysis, an urn ensures that predefined combinations are equally likely to be drawn. 
 +
 +**Advice:** Entire questionnaires __cannot__ be randomized using urns. An urn cannot be used to "choose" between different questionnaires. In order to use an urn, all random conditions in the questionnaire have to be set using a filter (see [[:en:create:randomization]]).
 +
 +**Note:** Be sure to carry out a technical test to check whether the drawing of lots in the urn are counted correctly, in particular, if you store the combinations manually.
 +
 +The basic steps to draw from an urn are as follows:
 +
 +  - Add a new question in the **List of Questions** using the type [[:de:create:questions:internal|Internal Variables]] (e.g. with ID ''IV01'')
 +  - In **Special Features** -> **Randomization Using Urns** -> //Create new urn//, e.g. with the //ID// ("group") and enter ballots 1, 2, 3, 4 (each number on a separate line)
 +  - [[php|PHP code]] is used to carry out the actual random draw.
 +
 +<code php>
 +urnDraw('group', 'IV01');
 +</code>
 +
 +**Note:** Only the question ID is entered as the second parameter in the function ''[[:en:create:functions:urndraw|urnDraw()]]'', and not the variable ID. This means SoSci Survey can decide, depending  on the content of the urn, if only one variable is used (if each ballot only contains one value) or several variables (if you are working with combinations of values).
 +
 +**Note:** You can decide whether the ballot drawn should be stored immediately or not until later. Read the the reference to the PHP function ''[[:en:create:functions:urndraw|urnDraw()]]'' for more information.
 +
 +**Note:** Normally the urn is re-filled after the last ballot is drawn and stored. If you do not want this to happen, you can prevent this happening directly with the drawing: see ''[[:en:create:functions:urndraw|urnDraw()]]''
 +
  
 ===== Create an Urn ===== ===== Create an Urn =====
Line 50: Line 79:
     * If you are using combinations (multiple values per ballot, and so multiple columns in the urn), you need the same number of variables as the number of values the combinations have. For example, if you have 10 ballots with 3 values in your urn, you need to have 3 variables in the question.     * If you are using combinations (multiple values per ballot, and so multiple columns in the urn), you need the same number of variables as the number of values the combinations have. For example, if you have 10 ballots with 3 values in your urn, you need to have 3 variables in the question.
     * Note down the question ID that you have just created (e.g. ''IV01'').      * Note down the question ID that you have just created (e.g. ''IV01''). 
-  + 
 +**Important:** Please use this question of type "Internal Variables" for the urn exclusively. Although it is technically possible to create further variables in the question, do not store data there via ''put()''. If you need to store additional data, create another question. Drawing from the urn will not work if something is stored in __any__ variable of the question.   
  
 ===== Draw a Ballot from the Urn ===== ===== Draw a Ballot from the Urn =====
en/create/random_urns.txt · Last modified: 04.06.2019 21:25 by admin
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki