Skip to main content

Address Concept

Introduction

The concept of questionnaire addresses serves as a pivotal element within the analysis framework, unlocking a wealth of information crucial for comprehensive assessments. Understanding questionnaire addresses is fundamental to conducting thorough analyses.

Address Elements

Addresses manifest within various elements, each contributing distinct attributes:

Analyse Expressions

  • Type:
    • Appears within:
      • The a attribute of <dig>, <g>, <qt>, <xt>, and <xtc> tags.
      • The acc attribute of <g> and <xt> tags.
      • The market attribute of <g> and <xt> tags.
      • The b attribute of <g>, <xt>, and <xtc> tags.
      • The supcol and suprow attributes of the <xtc> tag.

Arithmetical Expression

  • Type:
    • def attribute of the <a> tag.

Logical Expression

  • Type:
    • def attribute of the <filter> and <l> tags.
    • universe attribute of the <adoc> tag.

Text Expression

  • Type:
    • t attribute of <a>, <filter>, and <l> tags.
    • tf, th, tq, tr, and ts attributes of <g>, <qt>, <xt>, and <xtc> tags.
    • template attribute of the <dig> tag.

Analyse Expressions Overview

Analyse expressions primarily reside within <g>, <qt>, and <xt> tags, serving as the most comprehensive instance. Other address expressions stem from this, encompassing functionalities within their subsets.

Address Syntax

The address syntax adheres to the following format:

\Org.rule<base>Q.S.R[H]#F

Main Address Part

  • The Q.S.R[H]#F segment represents the main address part.

Address Expression Components

The address expression comprises the subsequent components:

  • \:
    • Always the initial character of the address.
  • Org.rule\ (Optional):
    • Specifies the sequence for organizing address elements.
    • Default values:
      • <g> and <xt>: QSRHF.
      • <qt>: QRF,SH.
  • Scalar and Vectorial Components:
    • Presented in the QSRHF permutation sequence for scalar and vectorial elements, respectively.

Understanding this syntax enables the utilization of questionnaire addresses to harness the breadth of information crucial for comprehensive analyses.

  • Components not present within the main address are left out.
  • <base>: Optional part specifying the base for percentage, average, and deviation computations. It can be:
    • all: The Filter population (standard for categorical blocks).
    • ¤: Population corresponding to the question item's existence.
    • ?: Population corresponding to the posed question item.
    • *: Population corresponding to the answered question item.
    • CAT_ADDR: Population corresponding to CAT_ADDR (categorical address expression).
      • If vectorial, the number of elements must match the number of rows in the row blocks, i.e., the elements within the low priority main address component.
  • Q.S.R[H]#F: Main address part defining the address area for analysis. Symbols Q, S, R, H, and F represent components of the address:
    • Q: Question box(es) the address spans.
    • S: Sub question(s) within the Q area the address spans.
    • R: Row(s) within the Q area the address spans.
    • H: Answer code(s) within the Q.S area the address spans.
    • F: Frequency value(s) within the Q.S.R[H] area the address spans.
  • Commonalities among Q, S, R, and H components:
    • When a component is present in the questionnaire but not in the address, all elements are present as a vector of elements.
    • For every component present within the address:
      • Single component element implies scalar.
      • Multi-component element (separated by commas) implies vectorial.
      • Two or more elements can be concatenated using the ; operator: logical OR for categorical elements and arithmetical addition for quantitative elements.
  • Specifics about the sequence of elements:
    • a1,a2,...,an results in the same as a1,,an (,, represents several , elements).
    • a1;a2;...,an results in the same as a1:an (: represents several ; elements).
    • Avoid using ,, ,,, ;, :, within the same component, except for variants like a1:a2:a3 and a1,,a2,,a3.
    • Scalar address element construction requires all question items to be of the same type (e.g., all N or M, all RN or RM, all F, or all of the H data type).
  • F component specifics:
    • Unlike other components, F is relevant only when specified as part of the main address.
    • Content is limited to 0 and positive integers combined with ,, ,, and :.

Arithmetical Expressions

An arithmetical expression consists of terms and operators:

Terms:

  1. Address: Referring to data types N/M/RN/RM/F/H. The address may be terminated by <> or <constant> to specify values replacing not-answered cases.
  2. Function:
    • ABS: Absolute value of its argument
    • INT: Truncated integer of its argument
    • MAX: Maximum value of 2 or more arguments separated by |
    • MIN: Minimum value of 2 or more arguments separated by |
    • NINT: Rounding of the argument to the nearest integer. Syntax:
      • fname(argument) applies to ABS, INT, or NINT. Argument may be a constant or a scalar address.
      • fname{argument|argument|..} applies to MAX and MIN. Argument may be a constant, scalar, or vectorial address.
  3. Constant: May contain . as the decimal point.

Operators:

  1. +: Addition
  2. -: Subtraction
  3. *: Multiplication
  4. /: Division
  5. ¬: Exponentiation

Parentheses ( and ) control operator priority. The sets of parentheses must be balanced, and the number of right parentheses must not exceed the number of left parentheses when parsing the expression from left to right.

The result of an arithmetical expression will always be treated as data type G (double precision floating point). An address covering data types N/M/RN/RM will result in a count of the number of answers within the address area or, optionally, a sum of code values that these data types have.

Examples:

  • 2001-\74.1: \74.1 represents the year of birth. This expression calculates age in the year 2001. If \74.1 is not answered, the result will also be unanswered if ARITRULE=ALL or =ONE.
  • \8.c.1:8: Calculates the sum of all viewing time yesterday.
  • (2*\5001.1+5*\5002.1)/7: Results in a weighted average of the answer \5001.1 (weight 2) and the answer \5002.1 (weight 5).
  • max(\6.a|\6.b): Calculates the maximum value among values found in \6.a and \6.b.

ARITRULE and the use of < > in addresses:

If an address in an arithmetical expression does not have any answer, the complete expression will have no meaning by default, i.e., considered a non-answer. To avoid non-answers, there are 2 mechanisms available:

  1. <value>: Replaces all cases of non-answer.
  2. ARITRULE=ALL|ONE|NONE:
    • ALL: All addresses without <value> specified must be specified.
    • ONE: At least one address without <value> specified must be answered.
    • NONE: All addresses without <value> specified default to <0>, so the expression will always have an answer.

CODERULE attribute:

This attribute may be specified as ONE or VALUE:

  • ONE: All occurrences of addresses to data types N/M/RN/RM will count the number of answers within the address area.
  • VALUE: All occurrences of addresses to data types N/M/RN/RM will sum the code values of answers within the address area.

Logical Expressions

A logical expression is a statement executed on a case with two possible outcomes: True or False.

Basic Logical Expression:

A basic logical expression (Lb) will always be any of these types:

  • Address = Answerlist
  • Address = Answerlist#frequency
  • !Address = Answerlist
  • !Address = Answerlist#frequency

Where Address is a scalar questionnaire address that may be any of these:

  • \Q
  • \Q.S
  • \Q.R
  • \Q.S.R

Each of the components Q, S, and R may take these forms:

  • k
  • k;k;k...;k
  • k:k
  • k;k:k;k...;k

Where k represents any of Q, S, and R. Notice that the result will always be scalar. The ! (NOT-operator) in front of the address negates the result of the expression.

Where Answerlist is any of the following:

  • a1
  • a1;a2 ;an
  • a1:a2
  • a1;a2:a3;a4;. ;an

Where ai are codes when the address represents a N/M/RN/RM data type. When the address represents a F or H data type, ai are numerical quantities.

; (semicolon) separates single values and intervals, acting as a logical OR-operator. : (colon) is shorthand for a series of ;'s.

Special answer-related specifications:

  • ¤ meaning the question does exist
  • ? meaning the question is posed
    • meaning the question has an answer
    • meaning the question is posed but has no answer

¤, ?, and * may only appear on the above form (1), while - may only appear on forms (1) and (2).

Where #frequency is replaced by one of the following:

  • #f
  • #f1:f2

Where f and fi represent the number of answers within the address area. The possible values of fi are: 0, 1, 2, 3,... If the answer list is not present in the address, then all answers in the address area are considered.

Basic Logical Expressions

Examples:

  1. \1=1: Male
  2. \2=15:29: 15-29 years
  3. \3=2;4: Live in region West or North
  4. !\6.1=1: Does not think issue 1 is important
  5. \8.c.1:8=0:44: Watched less than 45 min yesterday
  6. \6.A=*: Has answered question 6.A
  7. \10.A;B=1: Has mentioned car make 1 either in sub-question A or B

General Logical Expression

A general logical expression may be described as:

( Lb & ( b & ( Lb ... ) ) ... )

Where:

  • Lb is a basic expression as described above.
  • & is the AND operator.
  • | is the OR operator.
  • ( ... ) indicates the left parenthesis for controlling execution priorities.
  • ) indicates the right parenthesis for controlling execution priorities.
  • ... indicates that the content between and is optional.
  • ... indicates that the preceding sequence may be repeated any number of times.

Special Addresses in Logical Expressions

  • \0 (Ex. \0=1:250): The address to the case number
  • \? (Ex. \?=1:100): The address to a random number generator covering the outcome area 1-1000

The generation of random numbers is determined so that if the same analysis run is repeated exactly (no changes done), the results will remain the same.

Restrictions

When one of the logical operators & or | appears, the other one cannot appear later within the expression unless parentheses separate them.

Examples

  • \1=1&\2=15:29: Male 15-29 years
  • \4=4&!\7.a=3: 60 years+ cannot receive channel TV2
  • (\9.a=1&!\9.a=2&\1=2)|(\9.a=2&!\9.a=1&\1=1): To be true:
    • either: Know company 1 but not 2 and be female or
    • know company 2 but not 1 and be male

Text Control and Text Expressions

Normally, all text made up in an analysis presentation is either text derived from the questionnaire or a system-defined text element. However, there's often a need to improve the generated text.

To override a default text, the following mechanisms are available:

  • Define a constant text with:

    • The <text> tag and a series of attributes to modify system text
    • The <sat> tag to assign text to an address component combination
    • The template concept appearing in several attributes
  • Define a text through the template mechanism:

    • The <a> tag t attribute to assign text to an arithmetic expression
    • The <l> tag t attribute to assign text to a logical expression
    • The <filter> tag t attribute to assign text to a logical expression
    • The <g>, <qt>, <xt>, and <xtc> tags tf, th, tq, tr, ts, and tv attributes to assign text to an analysis address component

The <text> tag provides a menu of system text control.

Example:

<text int='Observations' market='Total car market'/>

The <sat> tag is a simple way to define a connection between a questionnaire text location and a constant text. Whenever this text location is referenced in an analysis, that text will replace the default generated text.

Example:

<sat sa='\7.1:8'>All channels</sat>

This markup provides an illustration of how the <sat> tag is used to associate the text "All channels" with the questionnaire location \7.1:8.

The template mechanism is any composition of the following items:

  • text: A constant text, i.e., a text that contains neither of the below special items.
  • *: The default text composition specification, leaving the text composition to the system.
  • @Q: Insert the question box text.
  • @S: Insert the sub-question text.
  • @R: Insert the row text.
  • @H: Insert the RN/RM answer text.
  • @F: Insert the # generated text.
  • @V: Insert the F/H categorized values text.
  • @1: Insert the text connected to the low-level address component.
  • @2: Insert the composition of text derived from the two low-level address components.
  • @3: Insert the composition of text derived from the three low-level addresses components.
  • @4: Insert the composition of text derived from the four low-level.
  • @L[id]: Insert the system text identified by ID addresses components.
  • \ADDRESS: Insert the composition of text items that this address spans.

Example:

<l def='\6.b.1=1' t='Answer \6.b[1] to question \6.1'/>

This showcases how the <l> tag is used with the attributes def and t to create a text association within the analysis.