Translations of this page:

Multifactorial Experimental Design

While in the Single Factorial Design only one property of the stimulus is varied (e.g., whether a product carries an “organic” seal or not), in the multi-factorial design multiple properties are manipulated (e.g., organic seal and price). The combinations of the individual characteristics are also referred to as “vignette” or “cell” (e.g. “bio/price value”).

A special case of multifactorial designs is conjoint analysis, in which respondents must choose (multiple times) between two or more vignettes. Since conjoint analyses can be designed very differently, they are not covered in this guide.

Tip: To understand the PHP codes below, read the chapters Introduction to PHP code and Introduction to arrays.

Tip: For multifactorial designs with quasi-experimental factors, see Randomization per Block.

Stimulus Type

As an example, the following is a two-factor design in which respondents are presented with a product. The two manipulated factors are….

  • the presence of an organic seal with 2 expressions (1=no organic seal, 2=organic seal visible).
  • the price of the product with 3 characteristics (1=cheap, 2=medium-priced, 3=expensive)

This results in 6 vignettes or cells in the complete design:

  1. no organic seal and cheap
  2. no organic seal and medium price
  3. no organic seal and expensive
  4. organic seal visible and cheap
  5. organic seal visible and medium price
  6. organic sela visible and expensive

Considering these 6 vignettes as 6 manifestations of a factor, any multifactorial design can be translated into a single factorial design. For the implementation in SoSci Survey, it is now important how the experimental treatment (the stimulus) is designed:

  • If each vignette is present as an inseparable unit (e.g., the photo of a product as an image file or the description of the product as complete text in the questionnaire), then proceed as described in the instructions for the Single Factorial Design – except that you treat each vignette as a separate experimental group beschrieben. So in the 2-by-3 design outlined above, you would have 6 experimental groups.
  • If the different factors lead to changes in different places (e.g. different entries in a “product information”, different images per factor), then follow these instructions.

Implementation of Separate Factors

The following procedure is suitable for the technical implementation:

  1. Create a random number generator with all vignettes as described above and include it in the questionnaire.
  2. Copy the elements of the dragged vignette into internal variables using put().
  3. The presentation of each factor using Placeholders or PHP code (Randomization with PHP-Code).

Random Generator

Exactly what content you store in the randomizer depends on what stimulus you want to present at the end. However, it is advisable to store at least the individual factor specifications and a description of the vignette:

1 = 1, 1, no organic seal and cheap
2 = 1, 2, no organic seal and medium price
3 = 1, 3, no organic seal and expensive
4 = 2, 1, organic seal visible and cheap 
5 = 2, 2, organic seal visible and medium price
6 = 2, 3, organic seal visible and expensive

The comma can be used to separate the different details per vignette so that they can be stored separately in the data set and used separately in the PHP code.

Additional information about the vignettes can also be deposited. For example, a product photo could be stored for the (non-)presence of an organic seal and a price indication for the price:

1 = 1, 1, product_nob.jpg, "7,50 €",  no organic seal and cheap
2 = 1, 2, product_nob.jpg, "9,95 €",  no organic seal and medium price
3 = 1, 3, product_nob.jpg, "17,95 €", no organic seal and expensive
4 = 2, 1, product_bio.jpg, "7,50 €",  organic seal visible and cheap
5 = 2, 2, product_bio.jpg, "9,95 €",  organic seal visible and medium price
6 = 2, 3, product_bio.jpg, "17,95 €", organic sela visible and expensive

Please note the quotation marks around the price quote. These are necessary because a comma is used in the price quote itself. If you want to use a quotation mark within a specification, put a typographic (' and ') or two normal quotation marks ("") instead.

Tip: How to create a random generator, read in more detail under Single Factorial Design.

Intern Variables

The internal variables are a question type which creates additional variables in the dataset. Please create a new question of the type “internal variables” in the data set. Within this question you create as many variables (items) as you have provided columns in the random generator.

In the above example, there are 5 columns, corresponding to 5 variables:

  1. Type of organic seal (1=no organic, 2=organic seal)
  2. Price (1=cheap, 2=medium price, 3=expensive)
  3. Product image (name of the image file)
  4. Price as text
  5. Vignette description

In the following, two PHP functions are used to copy the information stored in the vignette as Comma-Separated-Values (CSV) into the internal variables:

  • The function value(..., 'csv') separates the values by comma and returns an array of the individual values for the vignette drawn by the random generator. So for example [["1", "3", "product_nos.jpg", "17,95 €", "no organic seal and expensive"]
  • The function putList() stores these single values into the internal variables.

If the random generator has the identifier “RG01” and the 5 internal variables were created in the question “RG02”, then the following PHP code copies the values into individual variables.

putList('RG02', value('RG01', 'csv'));

Here the same functionality is again divided into two steps for the sake of clarity:

$content = value('RG01', 'csv');
putList('RG02', $content);

Note: In order for the PHP code to access the drawn random number or tuple with the value() function, the random draw must already have occurred. This means that the random generator must be placed above the PHP code or on a previous page of the questionnaire when composing the questionnaire.

Presentation of the Stimulus

The presentation of the stimulus works as explained in the Randomization with PHP-Code manual or the instructions linked there.

You can use all internal variables for this, in which you have stored the values by means of putList(). So, for example, to display the appropriate image depending on the first factor, you can use the file name in variable RG02_03:

replace('%bild%', value('RG02_03'));
html('<div><img src="%image%§ alt=""></div>');

Of course, you can also swap the HTML code into a text (here e.g. “TX01”) and insert the placeholder %image% directly using show():

show('TX01', [
  '%image%' => value('RG02_03')

It would also be possible to work with the numeric code in RG02_01 and depending on it to include one of two texts (for example “TX02” and “TX03”) where you have stored the HTML code to display one of the images respectively.

if (value('RG02_01') == 1) {
} else {

Of course, you can also implement the second factor by using placeholders. In the following example, for example, the HTML code for the image and below it the price would be stored in the text “TX04”:

<div style="width: 400px; max-width: 100%; border: 1px solid #CCCCCC; margin: 2em 0;">
  <div style="margin: 0 auto 1em">
    <img src="%image%" alt="Produkt" style="max-width: 100%;">
  <div style="margin: 0 auto 0; font-size: 120%">

You would include this text “TX04” with the drawn vignette in the questionnaire as follows:

show('TX04', [
  '%image%' => value('RG02_03'),
  '%price%' => value('RG02_04')
en/create/randomization-mehrfaktoriell.txt · Last modified: 28.06.2021 19:54 by sophia.schauer
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki