This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
en:create:random_urns [09.01.2015 15:38] – admin | en: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: | ||
+ | |||
+ | **Important: | ||
+ | en sind nur für wenige spezielle Anwendungsfälle die beste Lösung. lease be sure to read the chapter on [[: | ||
+ | ==== Drawing without Replacement ==== | ||
+ | |||
+ | A random draw " | ||
+ | |||
+ | **Advice:** Entire questionnaires __cannot__ be randomized using urns. An urn cannot be used to " | ||
+ | |||
+ | **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 [[: | ||
+ | - In **Special Features** -> **Randomization Using Urns** -> //Create new urn//, e.g. with the //ID// (" | ||
+ | - [[php|PHP code]] is used to carry out the actual random draw. | ||
+ | |||
+ | <code php> | ||
+ | urnDraw(' | ||
+ | </ | ||
+ | |||
+ | **Note:** Only the question ID is entered as the second parameter in the function '' | ||
+ | |||
+ | **Note:** You can decide whether the ballot drawn should be stored immediately or not until later. Read the the reference to the PHP function '' | ||
+ | |||
+ | **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 '' | ||
+ | |||
===== 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. '' | * Note down the question ID that you have just created (e.g. '' | ||
- | | + | |
+ | **Important: | ||
===== Draw a Ballot from the Urn ===== | ===== Draw a Ballot from the Urn ===== |