<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>gregordimicom</title>
<link>https://gregordimi.com/</link>
<atom:link href="https://gregordimi.com/index.xml" rel="self" type="application/rss+xml"/>
<description>A blog built with Quarto</description>
<generator>quarto-1.9.37</generator>
<lastBuildDate>Thu, 23 Apr 2026 00:00:00 GMT</lastBuildDate>
<item>
  <title>Социология парламентарни избори 2026</title>
  <link>https://gregordimi.com/posts/election-sociology-analysis-2026/</link>
  <description><![CDATA[ 






<div id="cell-1" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;colab&quot;,&quot;value&quot;:{&quot;base_uri&quot;:&quot;https://localhost:8080/&quot;,&quot;height&quot;:255}}" data-outputid="e101cb43-5030-47f6-d748-b3d0a68c3c74" data-execution_count="1">
<details class="code-fold">
<summary>Show the code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pandas <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> pd</span>
<span id="cb1-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> requests</span>
<span id="cb1-3"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> json</span>
<span id="cb1-4"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb1-5"></span>
<span id="cb1-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1. Use the RAW URL from your gist (Note the 'gist.githubusercontent' domain)</span></span>
<span id="cb1-7">url <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://gist.githubusercontent.com/gregordimi/e0d3fe30e4f898c84ad25c38b39f6e44/raw/311a84fb7ce48c8bc47d61b359405d602b2aabd6/results2026.json"</span></span>
<span id="cb1-8"></span>
<span id="cb1-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 2. Fetch the data using requests</span></span>
<span id="cb1-10">response <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> requests.get(url)</span>
<span id="cb1-11">data <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> response.json()</span>
<span id="cb1-12"></span>
<span id="cb1-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 3. Your existing processing logic</span></span>
<span id="cb1-14">survey_list <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb1-15"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> data[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'surveys'</span>]:</span>
<span id="cb1-16">    entry <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'results'</span>].copy()</span>
<span id="cb1-17">    entry[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Agency'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'agency'</span>]</span>
<span id="cb1-18">    entry[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Date'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'date_iso'</span>]</span>
<span id="cb1-19">    entry[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Label'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'agency'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'date_label'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span></span>
<span id="cb1-20"></span>
<span id="cb1-21">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Store metadata separately if you want to use it for the cards</span></span>
<span id="cb1-22">    entry[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'metadata'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> s.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'metadata'</span>, {})</span>
<span id="cb1-23"></span>
<span id="cb1-24">    survey_list.append(entry)</span>
<span id="cb1-25"></span>
<span id="cb1-26">df <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(survey_list).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Label'</span>)</span>
<span id="cb1-27">actual <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.Series(data[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'actual'</span>], name<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'РЕАЛНИ РЕЗУЛТАТИ'</span>)</span>
<span id="cb1-28"></span>
<span id="cb1-29"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Данните за </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(df)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> проучвания са заредени успешно"</span>)</span>
<span id="cb1-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(url)</span>
<span id="cb1-31"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># df.head()</span></span></code></pre></div></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>Данните за 20 проучвания са заредени успешно
https://gist.githubusercontent.com/gregordimi/e0d3fe30e4f898c84ad25c38b39f6e44/raw/311a84fb7ce48c8bc47d61b359405d602b2aabd6/results2026.json</code></pre>
</div>
</div>
<section id="паспорти-на-публичните-социологически-изследвания-за-парламентарни-избори-2026" class="level1">
<h1>Паспорти на публичните социологически изследвания за парламентарни избори 2026</h1>
<p>Техническите данни за изследванията</p>
<div id="cell-3" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;colab&quot;,&quot;value&quot;:{&quot;base_uri&quot;:&quot;https://localhost:8080/&quot;,&quot;height&quot;:553}}" data-outputid="97220484-136b-4e89-8b68-8e1501957131" data-execution_count="2">
<details class="code-fold">
<summary>Show the code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> IPython.display <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> HTML, display</span>
<span id="cb3-2"></span>
<span id="cb3-3"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> render_facet_row(data):</span>
<span id="cb3-4">    all_cards <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb3-5"></span>
<span id="cb3-6">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> data[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'surveys'</span>]:</span>
<span id="cb3-7">        m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> s.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'metadata'</span>, {})</span>
<span id="cb3-8">        o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'other_metadata'</span>, {})</span>
<span id="cb3-9"></span>
<span id="cb3-10">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Strip-down card template</span></span>
<span id="cb3-11">        card_html <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb3-12"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">        &lt;div style="flex: 1; min-width: 220px; max-width: 300px; border: 1px solid #888;</span></span>
<span id="cb3-13"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">                    border-radius: 8px; padding: 12px; background: #fff; font-family: sans-serif;</span></span>
<span id="cb3-14"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">                    box-shadow: 2px 2px 5px rgba(0,0,0,0.05); font-size: 12px;"&gt;</span></span>
<span id="cb3-15"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">            &lt;div style="color: #111; font-weight: bold; border-bottom: 1px solid #eee;</span></span>
<span id="cb3-16"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">                        margin-bottom: 8px; padding-bottom: 4px; font-size: 13px;"&gt;</span></span>
<span id="cb3-17"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">                </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'agency'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'date_label'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb3-18"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">            &lt;/div&gt;</span></span>
<span id="cb3-19"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">            &lt;div style="color: #777; margin-bottom: 4px;"&gt;&lt;b&gt;Период:&lt;/b&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'date'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'N/A'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/div&gt;</span></span>
<span id="cb3-20"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">            &lt;div style="color: #777; margin-bottom: 4px;"&gt;&lt;b&gt;Извадка:&lt;/b&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sample_size'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'N/A'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/div&gt;</span></span>
<span id="cb3-21"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">            &lt;div style="color: #777; margin-bottom: 4px;"&gt;&lt;b&gt;Метод:&lt;/b&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'methodology'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'N/A'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;/div&gt;</span></span>
<span id="cb3-22"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">            &lt;div style="color: #777; font-size: 11px; margin-top: 8px; font-style: italic;"&gt;</span></span>
<span id="cb3-23"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">                Грешка: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'margin_of_error'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'N/A'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb3-24"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">            &lt;/div&gt;</span></span>
<span id="cb3-25"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">        &lt;/div&gt;</span></span>
<span id="cb3-26"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">        """</span></span>
<span id="cb3-27">        all_cards <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> card_html</span>
<span id="cb3-28"></span>
<span id="cb3-29">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Display wrapper with Flexbox</span></span>
<span id="cb3-30">    display(HTML(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb3-31"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    &lt;div style="display: flex; flex-wrap: wrap; gap: 15px; background: #f4f4f4; padding: 20px; border-radius: 12px;"&gt;</span></span>
<span id="cb3-32"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">        </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>all_cards<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb3-33"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    &lt;/div&gt;</span></span>
<span id="cb3-34"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    """</span>))</span>
<span id="cb3-35"></span>
<span id="cb3-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Execute to render all 19 cards</span></span>
<span id="cb3-37">render_facet_row(data)</span></code></pre></div></div>
</details>
<div class="cell-output cell-output-display">

    <div style="display: flex; flex-wrap: wrap; gap: 15px; background: #f4f4f4; padding: 20px; border-radius: 12px;">
        
        <div style="flex: 1; min-width: 220px; max-width: 300px; border: 1px solid #888;
                    border-radius: 8px; padding: 12px; background: #fff; font-family: sans-serif;
                    box-shadow: 2px 2px 5px rgba(0,0,0,0.05); font-size: 12px;">
            <div style="color: #111; font-weight: bold; border-bottom: 1px solid #eee;
                        margin-bottom: 8px; padding-bottom: 4px; font-size: 13px;">
                Маркет Линкс (16/02)
            </div>
            <div style="color: #777; margin-bottom: 4px;"><b>Период:</b> 07 - 13 февруари 2026 г.</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Извадка:</b> 1019 лица над 18 г. в страната</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Метод:</b> Пряко-лично интервю и онлайн анкета</div>
            <div style="color: #777; font-size: 11px; margin-top: 8px; font-style: italic;">
                Грешка: Не е посочена
            </div>
        </div>
        
        <div style="flex: 1; min-width: 220px; max-width: 300px; border: 1px solid #888;
                    border-radius: 8px; padding: 12px; background: #fff; font-family: sans-serif;
                    box-shadow: 2px 2px 5px rgba(0,0,0,0.05); font-size: 12px;">
            <div style="color: #111; font-weight: bold; border-bottom: 1px solid #eee;
                        margin-bottom: 8px; padding-bottom: 4px; font-size: 13px;">
                Мяра (17/02)
            </div>
            <div style="color: #777; margin-bottom: 4px;"><b>Период:</b> 9-15 февруари 2026 г.</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Извадка:</b> 812 пълнолетни български граждани</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Метод:</b> “Лице в лице” с таблети</div>
            <div style="color: #777; font-size: 11px; margin-top: 8px; font-style: italic;">
                Грешка: Не е посочена
            </div>
        </div>
        
        <div style="flex: 1; min-width: 220px; max-width: 300px; border: 1px solid #888;
                    border-radius: 8px; padding: 12px; background: #fff; font-family: sans-serif;
                    box-shadow: 2px 2px 5px rgba(0,0,0,0.05); font-size: 12px;">
            <div style="color: #111; font-weight: bold; border-bottom: 1px solid #eee;
                        margin-bottom: 8px; padding-bottom: 4px; font-size: 13px;">
                Тренд (23/02)
            </div>
            <div style="color: #777; margin-bottom: 4px;"><b>Период:</b> 12-18 февруари 2026 г.</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Извадка:</b> 1002 души</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Метод:</b> Стандартизирано интервю „лице в лице“</div>
            <div style="color: #777; font-size: 11px; margin-top: 8px; font-style: italic;">
                Грешка: ± 3,1%
            </div>
        </div>
        
        <div style="flex: 1; min-width: 220px; max-width: 300px; border: 1px solid #888;
                    border-radius: 8px; padding: 12px; background: #fff; font-family: sans-serif;
                    box-shadow: 2px 2px 5px rgba(0,0,0,0.05); font-size: 12px;">
            <div style="color: #111; font-weight: bold; border-bottom: 1px solid #eee;
                        margin-bottom: 8px; padding-bottom: 4px; font-size: 13px;">
                Център за анализи и маркетинг (26/02)
            </div>
            <div style="color: #777; margin-bottom: 4px;"><b>Период:</b> 17 - 24 февруари 2026 г.</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Извадка:</b> 1010 души</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Метод:</b> Пряко стандартизирано интервю по домовете</div>
            <div style="color: #777; font-size: 11px; margin-top: 8px; font-style: italic;">
                Грешка: ± 3,1%
            </div>
        </div>
        
        <div style="flex: 1; min-width: 220px; max-width: 300px; border: 1px solid #888;
                    border-radius: 8px; padding: 12px; background: #fff; font-family: sans-serif;
                    box-shadow: 2px 2px 5px rgba(0,0,0,0.05); font-size: 12px;">
            <div style="color: #111; font-weight: bold; border-bottom: 1px solid #eee;
                        margin-bottom: 8px; padding-bottom: 4px; font-size: 13px;">
                Алфа Рисърч (05/03)
            </div>
            <div style="color: #777; margin-bottom: 4px;"><b>Период:</b> 23 февруари – 2 март 2026 г.</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Извадка:</b> 1000 души</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Метод:</b> Пряко стандартизирано интервю по домовете с таблети</div>
            <div style="color: #777; font-size: 11px; margin-top: 8px; font-style: italic;">
                Грешка: Не е посочена
            </div>
        </div>
        
        <div style="flex: 1; min-width: 220px; max-width: 300px; border: 1px solid #888;
                    border-radius: 8px; padding: 12px; background: #fff; font-family: sans-serif;
                    box-shadow: 2px 2px 5px rgba(0,0,0,0.05); font-size: 12px;">
            <div style="color: #111; font-weight: bold; border-bottom: 1px solid #eee;
                        margin-bottom: 8px; padding-bottom: 4px; font-size: 13px;">
                Галъп (09/03)
            </div>
            <div style="color: #777; margin-bottom: 4px;"><b>Период:</b> 10 - 28 февруари 2026 г.</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Извадка:</b> 800 души</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Метод:</b> Стандартизирано персонално интервю тип face-to-face с таблети (TAPI)</div>
            <div style="color: #777; font-size: 11px; margin-top: 8px; font-style: italic;">
                Грешка: ±3,5%
            </div>
        </div>
        
        <div style="flex: 1; min-width: 220px; max-width: 300px; border: 1px solid #888;
                    border-radius: 8px; padding: 12px; background: #fff; font-family: sans-serif;
                    box-shadow: 2px 2px 5px rgba(0,0,0,0.05); font-size: 12px;">
            <div style="color: #111; font-weight: bold; border-bottom: 1px solid #eee;
                        margin-bottom: 8px; padding-bottom: 4px; font-size: 13px;">
                Сова Харис (16/03)
            </div>
            <div style="color: #777; margin-bottom: 4px;"><b>Период:</b> 7 - 12 март 2026 г.</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Извадка:</b> 1000 души</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Метод:</b> Стандартизирано интервю „лице в лице” в дома на респондента</div>
            <div style="color: #777; font-size: 11px; margin-top: 8px; font-style: italic;">
                Грешка: +/- 3,5%
            </div>
        </div>
        
        <div style="flex: 1; min-width: 220px; max-width: 300px; border: 1px solid #888;
                    border-radius: 8px; padding: 12px; background: #fff; font-family: sans-serif;
                    box-shadow: 2px 2px 5px rgba(0,0,0,0.05); font-size: 12px;">
            <div style="color: #111; font-weight: bold; border-bottom: 1px solid #eee;
                        margin-bottom: 8px; padding-bottom: 4px; font-size: 13px;">
                Маркет Линкс (18/03)
            </div>
            <div style="color: #777; margin-bottom: 4px;"><b>Период:</b> 7 - 15 март 2026 г.</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Извадка:</b> 1006 души</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Метод:</b> Пряко-лично интервю и онлайн анкета</div>
            <div style="color: #777; font-size: 11px; margin-top: 8px; font-style: italic;">
                Грешка: Не е посочена
            </div>
        </div>
        
        <div style="flex: 1; min-width: 220px; max-width: 300px; border: 1px solid #888;
                    border-radius: 8px; padding: 12px; background: #fff; font-family: sans-serif;
                    box-shadow: 2px 2px 5px rgba(0,0,0,0.05); font-size: 12px;">
            <div style="color: #111; font-weight: bold; border-bottom: 1px solid #eee;
                        margin-bottom: 8px; padding-bottom: 4px; font-size: 13px;">
                Мяра (20/03)
            </div>
            <div style="color: #777; margin-bottom: 4px;"><b>Период:</b> 7 - 16 март 2026 г.</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Извадка:</b> 809 души</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Метод:</b> “Лице в лице” с таблети</div>
            <div style="color: #777; font-size: 11px; margin-top: 8px; font-style: italic;">
                Грешка: +/- 3,5%
            </div>
        </div>
        
        <div style="flex: 1; min-width: 220px; max-width: 300px; border: 1px solid #888;
                    border-radius: 8px; padding: 12px; background: #fff; font-family: sans-serif;
                    box-shadow: 2px 2px 5px rgba(0,0,0,0.05); font-size: 12px;">
            <div style="color: #111; font-weight: bold; border-bottom: 1px solid #eee;
                        margin-bottom: 8px; padding-bottom: 4px; font-size: 13px;">
                Тренд (23/03)
            </div>
            <div style="color: #777; margin-bottom: 4px;"><b>Период:</b> 13-19 март 2026 г.</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Извадка:</b> 1001 души</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Метод:</b> Пряко полустандартизирано интервю „лице в лице” с таблет</div>
            <div style="color: #777; font-size: 11px; margin-top: 8px; font-style: italic;">
                Грешка: +/- 3,1%
            </div>
        </div>
        
        <div style="flex: 1; min-width: 220px; max-width: 300px; border: 1px solid #888;
                    border-radius: 8px; padding: 12px; background: #fff; font-family: sans-serif;
                    box-shadow: 2px 2px 5px rgba(0,0,0,0.05); font-size: 12px;">
            <div style="color: #111; font-weight: bold; border-bottom: 1px solid #eee;
                        margin-bottom: 8px; padding-bottom: 4px; font-size: 13px;">
                Маркет Линкс (23/03)
            </div>
            <div style="color: #777; margin-bottom: 4px;"><b>Период:</b> 17 - 21 март 2026 г.</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Извадка:</b> 1008 души</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Метод:</b> Пряко-лично интервю и онлайн анкета</div>
            <div style="color: #777; font-size: 11px; margin-top: 8px; font-style: italic;">
                Грешка: Не е посочена
            </div>
        </div>
        
        <div style="flex: 1; min-width: 220px; max-width: 300px; border: 1px solid #888;
                    border-radius: 8px; padding: 12px; background: #fff; font-family: sans-serif;
                    box-shadow: 2px 2px 5px rgba(0,0,0,0.05); font-size: 12px;">
            <div style="color: #111; font-weight: bold; border-bottom: 1px solid #eee;
                        margin-bottom: 8px; padding-bottom: 4px; font-size: 13px;">
                Алфа Рисърч (23/03)
            </div>
            <div style="color: #777; margin-bottom: 4px;"><b>Период:</b> 12-20 март 2026 г.</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Извадка:</b> 1000 души</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Метод:</b> Пряко стандартизирано интервю по домовете с таблети</div>
            <div style="color: #777; font-size: 11px; margin-top: 8px; font-style: italic;">
                Грешка: Не е посочена
            </div>
        </div>
        
        <div style="flex: 1; min-width: 220px; max-width: 300px; border: 1px solid #888;
                    border-radius: 8px; padding: 12px; background: #fff; font-family: sans-serif;
                    box-shadow: 2px 2px 5px rgba(0,0,0,0.05); font-size: 12px;">
            <div style="color: #111; font-weight: bold; border-bottom: 1px solid #eee;
                        margin-bottom: 8px; padding-bottom: 4px; font-size: 13px;">
                Алфа Рисърч (29/03)
            </div>
            <div style="color: #777; margin-bottom: 4px;"><b>Период:</b> 19-26 март 2026 г.</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Извадка:</b> 1000 души</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Метод:</b> Пряко стандартизирано интервю по домовете с таблети</div>
            <div style="color: #777; font-size: 11px; margin-top: 8px; font-style: italic;">
                Грешка: Не е посочена
            </div>
        </div>
        
        <div style="flex: 1; min-width: 220px; max-width: 300px; border: 1px solid #888;
                    border-radius: 8px; padding: 12px; background: #fff; font-family: sans-serif;
                    box-shadow: 2px 2px 5px rgba(0,0,0,0.05); font-size: 12px;">
            <div style="color: #111; font-weight: bold; border-bottom: 1px solid #eee;
                        margin-bottom: 8px; padding-bottom: 4px; font-size: 13px;">
                Галъп (03/04)
            </div>
            <div style="color: #777; margin-bottom: 4px;"><b>Период:</b> 20 - 30 март 2026 г.</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Извадка:</b> 820 души</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Метод:</b> Стандартизирано персонално интервю тип face-to-face с таблети (TAPI)</div>
            <div style="color: #777; font-size: 11px; margin-top: 8px; font-style: italic;">
                Грешка: ±3,5%
            </div>
        </div>
        
        <div style="flex: 1; min-width: 220px; max-width: 300px; border: 1px solid #888;
                    border-radius: 8px; padding: 12px; background: #fff; font-family: sans-serif;
                    box-shadow: 2px 2px 5px rgba(0,0,0,0.05); font-size: 12px;">
            <div style="color: #111; font-weight: bold; border-bottom: 1px solid #eee;
                        margin-bottom: 8px; padding-bottom: 4px; font-size: 13px;">
                Сова Харис (09/04)
            </div>
            <div style="color: #777; margin-bottom: 4px;"><b>Период:</b> 2 - 6 април 2026 г.</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Извадка:</b> 800 души</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Метод:</b> Стандартизирано интервю „лице в лице” в дома на респондента</div>
            <div style="color: #777; font-size: 11px; margin-top: 8px; font-style: italic;">
                Грешка: +/- 3,5%
            </div>
        </div>
        
        <div style="flex: 1; min-width: 220px; max-width: 300px; border: 1px solid #888;
                    border-radius: 8px; padding: 12px; background: #fff; font-family: sans-serif;
                    box-shadow: 2px 2px 5px rgba(0,0,0,0.05); font-size: 12px;">
            <div style="color: #111; font-weight: bold; border-bottom: 1px solid #eee;
                        margin-bottom: 8px; padding-bottom: 4px; font-size: 13px;">
                Маркет Линкс (16/04)
            </div>
            <div style="color: #777; margin-bottom: 4px;"><b>Период:</b> 7-14 април 2026 г.</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Извадка:</b> 1003 души</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Метод:</b> Пряко-лично интервю и онлайн анкета</div>
            <div style="color: #777; font-size: 11px; margin-top: 8px; font-style: italic;">
                Грешка: Липсва информация
            </div>
        </div>
        
        <div style="flex: 1; min-width: 220px; max-width: 300px; border: 1px solid #888;
                    border-radius: 8px; padding: 12px; background: #fff; font-family: sans-serif;
                    box-shadow: 2px 2px 5px rgba(0,0,0,0.05); font-size: 12px;">
            <div style="color: #111; font-weight: bold; border-bottom: 1px solid #eee;
                        margin-bottom: 8px; padding-bottom: 4px; font-size: 13px;">
                Алфа Рисърч (17/04)
            </div>
            <div style="color: #777; margin-bottom: 4px;"><b>Период:</b> 13 - 15 април 2026 г.</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Извадка:</b> 1000 души</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Метод:</b> Пряко стандартизирано интервю по домовете с таблети</div>
            <div style="color: #777; font-size: 11px; margin-top: 8px; font-style: italic;">
                Грешка: Не е посочена
            </div>
        </div>
        
        <div style="flex: 1; min-width: 220px; max-width: 300px; border: 1px solid #888;
                    border-radius: 8px; padding: 12px; background: #fff; font-family: sans-serif;
                    box-shadow: 2px 2px 5px rgba(0,0,0,0.05); font-size: 12px;">
            <div style="color: #111; font-weight: bold; border-bottom: 1px solid #eee;
                        margin-bottom: 8px; padding-bottom: 4px; font-size: 13px;">
                Тренд (17/04)
            </div>
            <div style="color: #777; margin-bottom: 4px;"><b>Период:</b> 13 - 16 април 2026 г.</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Извадка:</b> 1004 души</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Метод:</b> Пряко стандартизирано интервю „лице в лице” с таблет</div>
            <div style="color: #777; font-size: 11px; margin-top: 8px; font-style: italic;">
                Грешка: +/- 3,1%
            </div>
        </div>
        
        <div style="flex: 1; min-width: 220px; max-width: 300px; border: 1px solid #888;
                    border-radius: 8px; padding: 12px; background: #fff; font-family: sans-serif;
                    box-shadow: 2px 2px 5px rgba(0,0,0,0.05); font-size: 12px;">
            <div style="color: #111; font-weight: bold; border-bottom: 1px solid #eee;
                        margin-bottom: 8px; padding-bottom: 4px; font-size: 13px;">
                Галъп (17/04)
            </div>
            <div style="color: #777; margin-bottom: 4px;"><b>Период:</b> 08 - 16 април 2026 г.</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Извадка:</b> 803 души</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Метод:</b> Стандартизирано персонално интервю тип face-to-face</div>
            <div style="color: #777; font-size: 11px; margin-top: 8px; font-style: italic;">
                Грешка: +/- 3,3%
            </div>
        </div>
        
        <div style="flex: 1; min-width: 220px; max-width: 300px; border: 1px solid #888;
                    border-radius: 8px; padding: 12px; background: #fff; font-family: sans-serif;
                    box-shadow: 2px 2px 5px rgba(0,0,0,0.05); font-size: 12px;">
            <div style="color: #111; font-weight: bold; border-bottom: 1px solid #eee;
                        margin-bottom: 8px; padding-bottom: 4px; font-size: 13px;">
                Мяра (17/04)
            </div>
            <div style="color: #777; margin-bottom: 4px;"><b>Период:</b> 4 - 13 април 2026 г.</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Извадка:</b> 1002 души</div>
            <div style="color: #777; margin-bottom: 4px;"><b>Метод:</b> Лице в лице с таблети</div>
            <div style="color: #777; font-size: 11px; margin-top: 8px; font-style: italic;">
                Грешка: +/- 3,1%
            </div>
        </div>
        
    </div>
    
</div>
</div>
<section id="матрица-на-данните" class="level3">
<h3 class="anchored" data-anchor-id="матрица-на-данните">2. Матрица на данните</h3>
<p>Тази графика показва матрица на всички публикувани данни.</p>
<div id="cell-5" class="cell" data-execution_count="31">
<details class="code-fold">
<summary>Show the code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> seaborn <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> sns</span>
<span id="cb4-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb4-3"></span>
<span id="cb4-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1. Филтрираме колоните (същата логика)</span></span>
<span id="cb4-5">cols <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [c <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> df.columns <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Agency'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Date'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'metadata'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Не съм решил'</span>]]</span>
<span id="cb4-6"></span>
<span id="cb4-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 2. Сортираме партиите по техния реален резултат</span></span>
<span id="cb4-8">sorted_parties <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> actual[cols].sort_values(ascending<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>).index</span>
<span id="cb4-9"></span>
<span id="cb4-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 3. Вземаме СУРОВИТЕ ДАННИ (df вместо residuals)</span></span>
<span id="cb4-11">raw_data_matrix <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> df[sorted_parties]</span>
<span id="cb4-12"></span>
<span id="cb4-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 4. Визуализация</span></span>
<span id="cb4-14">plt.figure(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>))</span>
<span id="cb4-15"></span>
<span id="cb4-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Използваме 'YlGnBu' (Yellow-Green-Blue), защото това са абсолютни стойности (0-100),</span></span>
<span id="cb4-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># а не отклонения около нулата.</span></span>
<span id="cb4-18">sns.heatmap(raw_data_matrix,</span>
<span id="cb4-19">            annot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb4-20">            fmt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'.1f'</span>,</span>
<span id="cb4-21">            cmap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'YlGnBu'</span>,</span>
<span id="cb4-22">            linewidths<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">.5</span>,</span>
<span id="cb4-23">            cbar_kws<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'label'</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Прогнозиран процент (%)'</span>})</span>
<span id="cb4-24"></span>
<span id="cb4-25">plt.title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Матрица данни: Всички прогнози по партии'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, fontweight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bold'</span>, pad<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>)</span>
<span id="cb4-26">plt.xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Партия (подредена по реален изборен резултат)'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>)</span>
<span id="cb4-27">plt.ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Агенция / Дата'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>)</span>
<span id="cb4-28">plt.xticks(rotation<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">45</span>, ha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'right'</span>)</span>
<span id="cb4-29">plt.tight_layout()</span>
<span id="cb4-30"></span>
<span id="cb4-31">plt.show()</span></code></pre></div></div>
</details>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://gregordimi.com/posts/election-sociology-analysis-2026/index_files/figure-html/cell-4-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="матрица-на-отклоненията-residual-heatmap" class="level3">
<h3 class="anchored" data-anchor-id="матрица-на-отклоненията-residual-heatmap">2. Матрица на отклоненията (Residual Heatmap)</h3>
<p>Тази графика показва отклоненията на публукуваните възприятия от реалния изборен резултат</p>
<div id="cell-7" class="cell" data-execution_count="32">
<details class="code-fold">
<summary>Show the code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> seaborn <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> sns</span>
<span id="cb5-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb5-3"></span>
<span id="cb5-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1. Филтрираме само колоните с партии (изключваме метаданните и служебните категории)</span></span>
<span id="cb5-5">cols <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [c <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> df.columns <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Agency'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Date'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'metadata'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Не съм решил'</span>]]</span>
<span id="cb5-6"></span>
<span id="cb5-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 2. Изчисляваме остатъците (Прогноза минус Реалност)</span></span>
<span id="cb5-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Резултат &gt; 0: Партията е била надценена (Survey &gt; Actual)</span></span>
<span id="cb5-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Резултат &lt; 0: Партията е била подценена (Survey &lt; Actual)</span></span>
<span id="cb5-10">residuals <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> df[cols].sub(actual[cols], axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb5-11"></span>
<span id="cb5-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 3. Сортираме партиите по техния реален изборен резултат за по-добра четимост</span></span>
<span id="cb5-13">sorted_parties <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> actual[cols].sort_values(ascending<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>).index</span>
<span id="cb5-14"></span>
<span id="cb5-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 4. Визуализация на Heatmap</span></span>
<span id="cb5-16">plt.figure(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>))</span>
<span id="cb5-17">sns.heatmap(residuals[sorted_parties],</span>
<span id="cb5-18">            annot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb5-19">            fmt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'.1f'</span>,</span>
<span id="cb5-20">            cmap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'RdBu_r'</span>,</span>
<span id="cb5-21">            center<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb5-22">            linewidths<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">.5</span>,</span>
<span id="cb5-23">            cbar_kws<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'label'</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Отклонение (Процентни пунктове)'</span>})</span>
<span id="cb5-24"></span>
<span id="cb5-25">plt.title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Матрица на отклоненията: Прогноза срещу Реалност'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, fontweight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bold'</span>, pad<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>)</span>
<span id="cb5-26">plt.xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Партия (подредена по изборен резултат)'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>)</span>
<span id="cb5-27">plt.ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Агенция / Дата'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>)</span>
<span id="cb5-28">plt.xticks(rotation<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">45</span>, ha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'right'</span>)</span>
<span id="cb5-29">plt.tight_layout()</span>
<span id="cb5-30"></span>
<span id="cb5-31">plt.show()</span></code></pre></div></div>
</details>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://gregordimi.com/posts/election-sociology-analysis-2026/index_files/figure-html/cell-5-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="средна-абсолютна-грешка-mae" class="level3">
<h3 class="anchored" data-anchor-id="средна-абсолютна-грешка-mae">Средна Абсолютна Грешка (MAE)</h3>
<p>Средна абсолютна грешка. Измерва средната големина на отклоненията в набор от прогнози, без да отчита тяхната посока (дали е надценено или подценено). Всички грешки се третират с еднаква тежест.</p>
<p>Колкото по-ниска е стойността, толкова по-точни са били данните спрямо официално регистрирания вот в деня на изборите.</p>
<div id="cell-9" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;colab&quot;,&quot;value&quot;:{&quot;base_uri&quot;:&quot;https://localhost:8080/&quot;,&quot;height&quot;:824}}" data-outputid="66d641b2-e5e5-4e04-f545-665102301dd5" data-execution_count="5">
<details class="code-fold">
<summary>Show the code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb6-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb6-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb6-3"></span>
<span id="cb6-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1. Избор на партиите за сравнение (премахваме метаданните и служебните категории)</span></span>
<span id="cb6-5">cols <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [c <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> df.columns <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Agency'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Date'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'metadata'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Не съм решил'</span>]]</span>
<span id="cb6-6"></span>
<span id="cb6-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 2. Изчисляване на MAE за всеки ред спрямо 'actual'</span></span>
<span id="cb6-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Използваме .dropna(), за да сме сигурни, че сравняваме само съществуващи данни</span></span>
<span id="cb6-9">mae <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> df[cols].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">apply</span>(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: np.mean(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> actual[cols])), axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).sort_values()</span>
<span id="cb6-10"></span>
<span id="cb6-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 3. Визуализация</span></span>
<span id="cb6-12">plt.figure(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>), facecolor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'#f9f9f9'</span>)</span>
<span id="cb6-13">colors <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.cm.RdYlGn_r(np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(mae)))</span>
<span id="cb6-14"></span>
<span id="cb6-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Хоризонтален бар</span></span>
<span id="cb6-16">bars <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.barh(mae.index, mae.values, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>colors, edgecolor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'black'</span>, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>)</span>
<span id="cb6-17"></span>
<span id="cb6-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Добавяне на стойностите върху баровете</span></span>
<span id="cb6-19"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> bar <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> bars:</span>
<span id="cb6-20">    plt.text(bar.get_width() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, bar.get_y() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> bar.get_height()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb6-21">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bar<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>get_width()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">%'</span>, va<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'center'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>, fontweight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bold'</span>)</span>
<span id="cb6-22"></span>
<span id="cb6-23">plt.title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Класация по точност (MAE) - Парламентарни избори 2026'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, pad<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, fontweight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bold'</span>)</span>
<span id="cb6-24">plt.xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Средна грешка в процентни пунктове (по-малко е по-добре)'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>)</span>
<span id="cb6-25">plt.gca().invert_yaxis()  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Най-точните най-отгоре</span></span>
<span id="cb6-26">plt.grid(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x'</span>, linestyle<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'--'</span>, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb6-27">plt.tight_layout()</span>
<span id="cb6-28"></span>
<span id="cb6-29">plt.show()</span>
<span id="cb6-30"></span>
<span id="cb6-31"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Бонус: Кратка присъда</span></span>
<span id="cb6-32">winner <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mae.index[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb6-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"🏆 НАЙ-ТОЧНА ПРОГНОЗА: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>winner<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (Грешка: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>mae<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">%)"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://gregordimi.com/posts/election-sociology-analysis-2026/index_files/figure-html/cell-6-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>🏆 НАЙ-ТОЧНА ПРОГНОЗА: Мяра (17/04) (Грешка: 1.99%)</code></pre>
</div>
</div>
</section>
<section id="средноквадратична-грешка.-rmse" class="level3">
<h3 class="anchored" data-anchor-id="средноквадратична-грешка.-rmse">Средноквадратична грешка. (RMSE)</h3>
<p>Изчислява се като корен квадратен от средната стойност на квадратите на разликите. Тъй като грешките се вдигат на квадрат преди да се усреднят, тази метрика дава много по-голяма тежест на големите отклонения.</p>
<p>Колкото по-ниска е стойността, толкова по-точни са били данните спрямо официално регистрирания вот в деня на изборите.</p>
<div id="cell-11" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;colab&quot;,&quot;value&quot;:{&quot;base_uri&quot;:&quot;https://localhost:8080/&quot;,&quot;height&quot;:824}}" data-outputid="fe2fe112-9ebb-4d99-da9c-ffe52e11ab35" data-execution_count="6">
<details class="code-fold">
<summary>Show the code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb8-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb8-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb8-3"></span>
<span id="cb8-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1. Избор на партиите</span></span>
<span id="cb8-5">cols <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [c <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> df.columns <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Agency'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Date'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'metadata'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Не съм решил'</span>]]</span>
<span id="cb8-6"></span>
<span id="cb8-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 2. Изчисляване на RMSE (Root Mean Square Error)</span></span>
<span id="cb8-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># RMSE = Квадратен корен от средната стойност на квадратите на разликите</span></span>
<span id="cb8-9">rmse <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> df[cols].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">apply</span>(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: np.sqrt(np.mean((x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> actual[cols])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)), axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).sort_values()</span>
<span id="cb8-10"></span>
<span id="cb8-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 3. Визуализация</span></span>
<span id="cb8-12">plt.figure(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>), facecolor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'#f9f9f9'</span>)</span>
<span id="cb8-13">colors <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.cm.RdYlGn_r(np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(rmse)))</span>
<span id="cb8-14"></span>
<span id="cb8-15">bars <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.barh(rmse.index, rmse.values, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>colors, edgecolor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'black'</span>, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>)</span>
<span id="cb8-16"></span>
<span id="cb8-17"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> bar <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> bars:</span>
<span id="cb8-18">    plt.text(bar.get_width() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, bar.get_y() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> bar.get_height()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb8-19">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bar<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>get_width()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>, va<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'center'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>, fontweight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bold'</span>)</span>
<span id="cb8-20"></span>
<span id="cb8-21">plt.title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Класация по точност (RMSE) - Парламентарни избори 2026'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, pad<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, fontweight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bold'</span>)</span>
<span id="cb8-22">plt.xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Корен квадратен от средноквадратичната грешка (по-малко е по-добре)'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>)</span>
<span id="cb8-23">plt.gca().invert_yaxis()</span>
<span id="cb8-24">plt.grid(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x'</span>, linestyle<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'--'</span>, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb8-25">plt.tight_layout()</span>
<span id="cb8-26"></span>
<span id="cb8-27">plt.show()</span>
<span id="cb8-28"></span>
<span id="cb8-29">winner <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rmse.index[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb8-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"🏆 НАЙ-ТОЧНА ПРОГНОЗА (RMSE): </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>winner<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (Грешка: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rmse<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://gregordimi.com/posts/election-sociology-analysis-2026/index_files/figure-html/cell-7-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>🏆 НАЙ-ТОЧНА ПРОГНОЗА (RMSE): Мяра (17/04) (Грешка: 3.33)</code></pre>
</div>
</div>
</section>
<section id="хронологичен-тренд" class="level3">
<h3 class="anchored" data-anchor-id="хронологичен-тренд">3. Хронологичен тренд</h3>
<p>Тук проследяваме как прогнозите за основните партии са се променяли във времето спрямо крайния резултат.</p>
<div id="cell-13" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;colab&quot;,&quot;value&quot;:{&quot;base_uri&quot;:&quot;https://localhost:8080/&quot;,&quot;height&quot;:1000}}" data-outputid="c0ab7a85-4892-42aa-fc85-713c0c905886" data-execution_count="7">
<details class="code-fold">
<summary>Show the code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb10-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb10-2"></span>
<span id="cb10-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1. Списък с партиите, които искаме да проследим</span></span>
<span id="cb10-4">target_parties <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Прогресивна България'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ГЕРБ'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ПП-ДБ'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ДПС'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Възраждане'</span>]</span>
<span id="cb10-5"></span>
<span id="cb10-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 2. Сортираме данните хронологично</span></span>
<span id="cb10-7">trend_df <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> df.sort_values(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Date'</span>)</span>
<span id="cb10-8"></span>
<span id="cb10-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 3. Цикъл за генериране на всяка графика</span></span>
<span id="cb10-10"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> party <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> target_parties:</span>
<span id="cb10-11">    plt.figure(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>))</span>
<span id="cb10-12"></span>
<span id="cb10-13">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Проверка дали партията съществува в данните (за избягване на грешки)</span></span>
<span id="cb10-14">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> party <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> trend_df.columns:</span>
<span id="cb10-15">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Плотване на прогнозите</span></span>
<span id="cb10-16">        plt.plot(trend_df.index, trend_df[party],</span>
<span id="cb10-17">                 marker<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'o'</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'#1f77b4'</span>, linewidth<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>, markersize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'Прогнози за </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>party<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>)</span>
<span id="cb10-18"></span>
<span id="cb10-19">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Линия за реалния резултат</span></span>
<span id="cb10-20">        actual_val <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> actual[party]</span>
<span id="cb10-21">        plt.axhline(y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>actual_val, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'#d62728'</span>, linestyle<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'--'</span>,</span>
<span id="cb10-22">                    linewidth<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'Реален резултат (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>actual_val<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">%)'</span>)</span>
<span id="cb10-23"></span>
<span id="cb10-24">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Оформление</span></span>
<span id="cb10-25">        plt.title(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'Динамика на прогнозите: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>party<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, fontweight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bold'</span>, pad<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>)</span>
<span id="cb10-26">        plt.ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Подкрепа (%)'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>)</span>
<span id="cb10-27">        plt.xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Социологическо проучване'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>)</span>
<span id="cb10-28">        plt.xticks(rotation<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">45</span>, ha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'right'</span>)</span>
<span id="cb10-29">        plt.legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'best'</span>)</span>
<span id="cb10-30">        plt.grid(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'y'</span>, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>)</span>
<span id="cb10-31">        plt.tight_layout()</span>
<span id="cb10-32"></span>
<span id="cb10-33">        plt.show()</span>
<span id="cb10-34">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb10-35">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Партията '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>party<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">' не беше намерена в данните."</span>)</span></code></pre></div></div>
</details>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://gregordimi.com/posts/election-sociology-analysis-2026/index_files/figure-html/cell-8-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://gregordimi.com/posts/election-sociology-analysis-2026/index_files/figure-html/cell-8-output-2.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://gregordimi.com/posts/election-sociology-analysis-2026/index_files/figure-html/cell-8-output-3.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://gregordimi.com/posts/election-sociology-analysis-2026/index_files/figure-html/cell-8-output-4.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://gregordimi.com/posts/election-sociology-analysis-2026/index_files/figure-html/cell-8-output-5.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="анализ-на-ефекта-от-методологията-offline-vs.-hybrid" class="level3">
<h3 class="anchored" data-anchor-id="анализ-на-ефекта-от-методологията-offline-vs.-hybrid"><strong>Анализ на ефекта от методологията (Offline vs.&nbsp;Hybrid)</strong></h3>
<p>Статистическият модел (<strong>OLS</strong>) изолира „чистия“ ефект на изследователския метод върху точността на прогнозите. Вместо просто да гледаме крайната грешка, ние измерваме колко точно методологията <strong>„натежава“</strong> върху резултата, като контролираме за фактори кога е правено проучването или колко голяма е била извадката.</p>
<p>Трябва да се отбележи, че в текущата извадка хибридният метод се припокрива значително с една от конкретните агенции и не може категорично да се изолира дали източникът на влияние е самата агенция, или методологията. Както при много статистически изследвания, основният извод и препоръка остават: „further research needed, need more data“.</p>
<section id="основни-изводи-за-коефициентите" class="level4">
<h4 class="anchored" data-anchor-id="основни-изводи-за-коефициентите"><strong>Основни изводи за коефициентите:</strong></h4>
<ul>
<li><strong>Линеен шум (+1.06):</strong> Използването на хибриден метод (онлайн + офлайн) автоматично вкарва малко над 1 процентен пункт допълнително отклонение в средната грешка (<strong>MAE</strong>) спрямо чисто офлайн проучванията.</li>
<li><strong>Квадратна грешка (+2.82):</strong> При квадратичната грешка (<strong>RMSE</strong>), наказанието за хибридния метод е близо три пъти по-високо. Това показва, че онлайн панелите са склонни да генерират „изненади“ - те не просто бъркат малко, а саклонни да генерират и по-големи пропуски.</li>
</ul>
<p>Нека разгледаме проучване, проведено на <strong>17 април (2 дни преди изборите)</strong> с извадка от <strong>1000 души</strong>, за да видим как изборът на метод променя очакваната точност:</p>
<p><strong>Пример 1: Средно отклонение (MAE)</strong> Ако заложите на традиционното проучване „лице в лице“, моделът предвижда средна грешка от около <strong>2.35%</strong>. Ако при абсолютно същите условия използвате <strong>хибриден подход</strong>, очакваното средно отклонение от истината скача на <strong>3.41%</strong> (допълнителни +1.06 пункта). Това е цената на „шума“ от онлайн сегмента.</p>
<p><strong>Пример 2: Риск от сериозно разминаване (RMSE)</strong> Тук разликата е драстична. При офлайн проучване очакваната квадратична грешка е <strong>4.03</strong>. При <strong>хибридния подход</strong> обаче тя скача до <strong>6.85</strong>. Това огромно нарастване (с над 2.8 пункта) означава, че хибридната методология е <strong>по-несигурна</strong>. В реалността това често се изразява в „наказване“ на конкретна партия — например, докато офлайн методът би хванал вълната за <em>Прогресивна България</em> с малка разлика, хибридната методология може да я подцени с десетки проценти, фаворизирайки погрешно статуквото.</p>
</section>
</section>
<section id="относно-разликата-в-mae-и-rmse" class="level2">
<h2 class="anchored" data-anchor-id="относно-разликата-в-mae-и-rmse">Относно разликата в MAE и RMSE</h2>
<p>Има разминаване между предходните графики и графиките на OLS модела за двата индикатора (MAE и RMSE), тъй като те са изчислени на различна база.</p>
<section id="защо" class="level3">
<h3 class="anchored" data-anchor-id="защо">Защо?</h3>
<ul>
<li><strong>Знаменателят (<img src="https://latex.codecogs.com/png.latex?n">):</strong> MAE (Средна абсолютна грешка) се пресмята, като сумата от грешките се раздели на броя на категориите (<img src="https://latex.codecogs.com/png.latex?n">).</li>
<li>Когато включваме категории с традиционно малка грешка (като „Други“ или „Не подкрепям никого“), делим общата сума на по-голямо число (напр. 12). Това изкуствено намалява средната стойност (в случая до <strong>2.4%</strong>).</li>
<li>OLS моделът филтрира само важните политически субекти (напр. 8 партии). Сумата от грешките се дели на по-малко число, което логично повишава MAE до <strong>3.1%</strong>.</li>
</ul>
<p>Налице са две различни стойности за MAE и RMSE за едно и също проучване, което може да изглежда объркващо: 1. <strong>2.4% (в началните бар чартове):</strong> Изчислена върху <strong>всички категории</strong> (вкл. „Други“, „Не подкрепям никого“). 2. <strong>3.1% (в OLS модела):</strong> Изчислена само върху <strong>реалните политически партии</strong>.</p>
<hr>
</section>
<section id="защо-mae-и-rmse-дават-различни-резултати" class="level3">
<h3 class="anchored" data-anchor-id="защо-mae-и-rmse-дават-различни-резултати">Защо MAE и RMSE дават различни резултати?</h3>
<p>Разликата в поведението на двата индикатора в графиките се дължи на начина, по който те „наказват“ отклоненията:</p>
<ul>
<li><strong>MAE (Mean Absolute Error):</strong> Това е линеен показател. Ако сгрешиш с 10% при една партия, това добавя точно 10 единици към общата сума. MAE е по-усреднен и „скрива“ големите гафове, ако останалите данни са точни.</li>
<li><strong>RMSE (Root Mean Square Error):</strong> Това е квадратичен показател. Тук всяка грешка се повдига на квадрат, преди да се изчисли средното. Това означава, че голяма грешка (например при победителя) тежи прогресивно повече от много малки грешки.
<ul>
<li><em>Затова в OLS анализа хибридните методи изглеждат по-зле:</em> Те често познават малките партии, но допускат голямо разминаване при големите играчи. RMSE улавя именно този риск от „фатален провал“.</li>
</ul></li>
</ul>
</section>
<section id="пример-с-маркет-линкс-1604" class="level3">
<h3 class="anchored" data-anchor-id="пример-с-маркет-линкс-1604">Пример с „Маркет Линкс“ (16/04)</h3>
<p>Нека приемем, че сумата от всички отклонения за проучването е <strong>24.8 процентни пункта</strong>.</p>
<ul>
<li><strong>При изчисление за бар чарт (MAE):</strong> Включваме 10-12 категории (всички партии + „Други“ + „Не подкрепям“). Делим <img src="https://latex.codecogs.com/png.latex?24.8"> на <img src="https://latex.codecogs.com/png.latex?12"> и получаваме <strong>2.06%</strong>. Агенцията изглежда изключително точна, защото „безопасните“ категории свалят средното.</li>
<li><strong>При изчисление за OLS модел (MAE):</strong> Гледаме само 8-те основни партии. Делим <img src="https://latex.codecogs.com/png.latex?24.8"> на <img src="https://latex.codecogs.com/png.latex?8"> и получаваме <strong>3.10%</strong>. Това е реалният политически риск.</li>
<li><strong>При изчисление на RMSE:</strong> Ако от тези 24.8 пункта грешка, 15 пункта идват само от една партия (напр. ПБ), RMSE ще „експлодира“ нагоре, показвайки, че методологията е нестабилна, докато MAE ще остане привидно ниско.</li>
</ul>
<div id="cell-15" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;colab&quot;,&quot;value&quot;:{&quot;base_uri&quot;:&quot;https://localhost:8080/&quot;,&quot;height&quot;:1000}}" data-outputid="2f7d75dd-3c28-4bfc-f463-3e2832825fc7" data-execution_count="30">
<details class="code-fold">
<summary>Show the code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb11-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> statsmodels.api <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> sm</span>
<span id="cb11-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb11-3"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pandas <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> pd</span>
<span id="cb11-4"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb11-5"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> seaborn <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> sns</span>
<span id="cb11-6"></span>
<span id="cb11-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 1. ПРЕЦИЗНО ИЗЧИСЛЯВАНЕ НА МЕТРИКИТЕ ---</span></span>
<span id="cb11-8">party_cols <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [c <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> df.columns <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> actual.index]</span>
<span id="cb11-9"></span>
<span id="cb11-10"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> calculate_metrics(row):</span>
<span id="cb11-11">    diffs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> row[party_cols] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> actual[party_cols]</span>
<span id="cb11-12">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> pd.Series({</span>
<span id="cb11-13">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'MAE'</span>: np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(diffs).mean(),</span>
<span id="cb11-14">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'RMSE'</span>: np.sqrt((diffs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).mean())</span>
<span id="cb11-15">    })</span>
<span id="cb11-16"></span>
<span id="cb11-17">metrics_df <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> df.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">apply</span>(calculate_metrics, axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb11-18"></span>
<span id="cb11-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 2. ПОДГОТОВКА НА ДАННИТЕ ЗА РЕГРЕСИЯ ---</span></span>
<span id="cb11-20">election_date <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.to_datetime(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'2026-04-19'</span>)</span>
<span id="cb11-21">ols_data <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb11-22"></span>
<span id="cb11-23"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> idx, row <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> df.iterrows():</span>
<span id="cb11-24">    enc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> row[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'metadata'</span>].get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'encoded'</span>, {})</span>
<span id="cb11-25">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> enc: <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb11-26"></span>
<span id="cb11-27">    ols_data.append({</span>
<span id="cb11-28">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Label'</span>: idx,</span>
<span id="cb11-29">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'MAE'</span>: metrics_df.loc[idx, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'MAE'</span>],</span>
<span id="cb11-30">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'RMSE'</span>: metrics_df.loc[idx, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'RMSE'</span>],</span>
<span id="cb11-31">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Is_Hybrid'</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> enc.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'methodology'</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'hybrid'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb11-32">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Days_To_Election'</span>: (election_date <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pd.to_datetime(enc.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'date'</span>))).days,</span>
<span id="cb11-33">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Sample_Size'</span>: enc.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sample_size'</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb11-34">    })</span>
<span id="cb11-35"></span>
<span id="cb11-36">reg_df <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(ols_data).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Label'</span>).dropna()</span>
<span id="cb11-37"></span>
<span id="cb11-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 3. ИЗПЪЛНЕНИЕ НА РЕГРЕСИИТЕ ---</span></span>
<span id="cb11-39">X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sm.add_constant(reg_df[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Is_Hybrid'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Days_To_Election'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Sample_Size'</span>]])</span>
<span id="cb11-40">model_mae <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sm.OLS(reg_df[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'MAE'</span>], X).fit()</span>
<span id="cb11-41">model_rmse <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sm.OLS(reg_df[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'RMSE'</span>], X).fit()</span>
<span id="cb11-42"></span>
<span id="cb11-43"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 4. ВИЗУАЛИЗАЦИЯ 1: ВЛИЯНИЕ НА ФАКТОРИТЕ (КОЕФИЦИЕНТИ) ---</span></span>
<span id="cb11-44">fig1, (ax1, ax2) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), sharey<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb11-45">plt.subplots_adjust(wspace<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb11-46"></span>
<span id="cb11-47"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># MAE Coefs</span></span>
<span id="cb11-48">model_mae.params[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:].plot(kind<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'barh'</span>, xerr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>model_mae.bse[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'#3498db'</span>, ax<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ax1, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, edgecolor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'black'</span>)</span>
<span id="cb11-49">ax1.axvline(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'red'</span>, linestyle<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'--'</span>, linewidth<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb11-50">ax1.set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Въздействие върху MAE</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">(Линейна средна грешка)'</span>, fontweight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bold'</span>)</span>
<span id="cb11-51">ax1.set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Промяна в % пунктове'</span>)</span>
<span id="cb11-52"></span>
<span id="cb11-53"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># RMSE Coefs</span></span>
<span id="cb11-54">model_rmse.params[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:].plot(kind<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'barh'</span>, xerr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>model_rmse.bse[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'#e74c3c'</span>, ax<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ax2, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, edgecolor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'black'</span>)</span>
<span id="cb11-55">ax2.axvline(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'red'</span>, linestyle<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'--'</span>, linewidth<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb11-56">ax2.set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Въздействие върху RMSE</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">(Наказание за големи грешки)'</span>, fontweight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bold'</span>)</span>
<span id="cb11-57">ax2.set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Промяна в % пунктове'</span>)</span>
<span id="cb11-58"></span>
<span id="cb11-59">plt.suptitle(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'АНАЛИЗ НА ФАКТОРИТЕ ЗА ГРЕШКА (OLS REGRESSION COEF)'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, fontweight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bold'</span>, y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>)</span>
<span id="cb11-60">plt.show()</span>
<span id="cb11-61"></span>
<span id="cb11-62"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 5. ВИЗУАЛИЗАЦИЯ 2: SIDE-BY-SIDE ТАГНАТА ДИНАМИКА (MAE vs RMSE) ---</span></span>
<span id="cb11-63">fig2, (ax3, ax4) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>), sharex<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb11-64">palette <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'#3498db'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'#e74c3c'</span>]</span>
<span id="cb11-65"></span>
<span id="cb11-66"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> ax, metric, color, title <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>([ax3, ax4], [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'MAE'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'RMSE'</span>], palette, [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'MAE (Линейна)'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'RMSE (Квадратична)'</span>]):</span>
<span id="cb11-67">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Scatter plot</span></span>
<span id="cb11-68">    sns.scatterplot(</span>
<span id="cb11-69">        data<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>reg_df, x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Days_To_Election'</span>, y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>metric,</span>
<span id="cb11-70">        hue<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Is_Hybrid'</span>, size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Sample_Size'</span>, sizes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">150</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>),</span>
<span id="cb11-71">        palette<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>palette, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, edgecolor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'white'</span>, linewidth<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, ax<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ax</span>
<span id="cb11-72">    )</span>
<span id="cb11-73"></span>
<span id="cb11-74">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Тагване на всяка точка</span></span>
<span id="cb11-75">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> label, row <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> reg_df.iterrows():</span>
<span id="cb11-76">        ax.text(</span>
<span id="cb11-77">            x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>row[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Days_To_Election'</span>],</span>
<span id="cb11-78">            y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>row[metric] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (row[metric] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>), <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># динамично отместване нагоре</span></span>
<span id="cb11-79">            s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>label, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, fontweight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'semibold'</span>, ha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'center'</span>,</span>
<span id="cb11-80">            bbox<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(facecolor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'white'</span>, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, edgecolor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'none'</span>, pad<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb11-81">        )</span>
<span id="cb11-82"></span>
<span id="cb11-83">    ax.invert_xaxis()</span>
<span id="cb11-84">    ax.set_title(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'Динамика на </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>title<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> грешката'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, fontweight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bold'</span>)</span>
<span id="cb11-85">    ax.set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Дни до изборния ден'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>)</span>
<span id="cb11-86">    ax.set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Стойност на грешката'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>)</span>
<span id="cb11-87">    ax.grid(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, linestyle<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">':'</span>, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>)</span>
<span id="cb11-88">    ax.get_legend().remove() <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># премахваме индивидуалните легенди за по-чист вид</span></span>
<span id="cb11-89"></span>
<span id="cb11-90"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Единна легенда за целия плот</span></span>
<span id="cb11-91">handles, labels <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ax4.get_legend_handles_labels()</span>
<span id="cb11-92">fig2.legend(handles, labels, title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Метод (0=Offline, 1=Hybrid) &amp; Извадка'</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'center right'</span>, bbox_to_anchor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>))</span>
<span id="cb11-93"></span>
<span id="cb11-94">plt.suptitle(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'СРАВНИТЕЛНА ХРОНОЛОГИЯ НА КАЧЕСТВОТО (ТАГНАТИ НАБЛЮДЕНИЯ)'</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, fontweight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bold'</span>, y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.98</span>)</span>
<span id="cb11-95">plt.tight_layout()</span>
<span id="cb11-96">plt.show()</span>
<span id="cb11-97"></span>
<span id="cb11-98"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 6. СТРУКТУРИРАН ТЕКСТОВ АУТПУТ ---</span></span>
<span id="cb11-99"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"="</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>)</span>
<span id="cb11-100"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" СРАВНИТЕЛЕН АНАЛИЗ НА КОЕФИЦИЕНТИТЕ (MAE vs RMSE)"</span>)</span>
<span id="cb11-101"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"="</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>)</span>
<span id="cb11-102">summary_table <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame({</span>
<span id="cb11-103">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Metric'</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Is_Hybrid'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Days_To_Election'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Sample_Size'</span>],</span>
<span id="cb11-104">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'MAE Coef'</span>: model_mae.params[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:].values,</span>
<span id="cb11-105">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'MAE P-value'</span>: model_mae.pvalues[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:].values,</span>
<span id="cb11-106">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'RMSE Coef'</span>: model_rmse.params[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:].values,</span>
<span id="cb11-107">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'RMSE P-value'</span>: model_rmse.pvalues[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:].values</span>
<span id="cb11-108">}).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)</span>
<span id="cb11-109"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(summary_table.to_string(index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>))</span>
<span id="cb11-110"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"="</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>)</span></code></pre></div></div>
</details>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://gregordimi.com/posts/election-sociology-analysis-2026/index_files/figure-html/cell-9-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://gregordimi.com/posts/election-sociology-analysis-2026/index_files/figure-html/cell-9-output-2.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
============================================================
 СРАВНИТЕЛЕН АНАЛИЗ НА КОЕФИЦИЕНТИТЕ (MAE vs RMSE)
============================================================
          Metric  MAE Coef  MAE P-value  RMSE Coef  RMSE P-value
       Is_Hybrid    1.0574       0.0000     2.8161        0.0000
Days_To_Election    0.0051       0.1617     0.0056        0.4806
     Sample_Size   -0.0005       0.5626    -0.0010        0.5954
============================================================</code></pre>
</div>
</div>
</section>
<section id="заключение-и-изводи-от-анализа" class="level3">
<h3 class="anchored" data-anchor-id="заключение-и-изводи-от-анализа">Заключение и изводи от анализа</h3>
<ul>
<li><strong>Системен пропуск:</strong>
<ul>
<li>Всички агенции подцениха победителя (<strong>Прогресивна България</strong>) с над 10% средно отклонение.</li>
<li>Всички агенции надцениха установените играчи (<strong>ГЕРБ, ДПС, Възраждане</strong>) в различна степен.</li>
</ul></li>
<li><strong>Методология:</strong>
<ul>
<li>Необходима е ревизия на моделите за разпределение на гласовете на нерешилите избиратели.</li>
<li>Необходима е критична ревизия на източниците и структурирането на извадката.</li>
</ul></li>
<li><strong>Информационна хигиена:</strong>
<ul>
<li>Ефирът е пълен с демографски, психографски и поведенчески разпределения на вота, към които трябва да се подходи със скептицизъм, имайки предвид мащаба на анализираните отклонения.</li>
<li>Анализи на по-малки кохорти (напр. от типа “коя партия е донор на гласоподаватели”) носят риск да са значително по-неточни.</li>
</ul></li>
<li><strong>Забележка:</strong>
<ul>
<li>Нормализирането на толкова голям набор от изследвания изисква задълбочена работа.</li>
<li>Този анализ е по-скоро отправна точка за по-задълбочени бъдещи мета-анализи, целящи повишаване на прогнозната сила.</li>
<li>Най-належащата задача би била ръчното преглеждане и коригиране на входящите данни.</li>
</ul></li>
</ul>
<div id="cell-17" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;colab&quot;,&quot;value&quot;:{&quot;base_uri&quot;:&quot;https://localhost:8080/&quot;,&quot;height&quot;:34}}" data-outputid="97f0b48a-50e5-4610-aa21-cb6be0a68ae7" data-execution_count="10">
<details class="code-fold">
<summary>Show the code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb13-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># '%pip install qrcode[pil] -q'</span></span>
<span id="cb13-2"></span>
<span id="cb13-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># import qrcode</span></span>
<span id="cb13-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># import matplotlib.pyplot as plt</span></span>
<span id="cb13-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># import seaborn as sns</span></span>
<span id="cb13-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># import numpy as np</span></span>
<span id="cb13-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># import pandas as pd</span></span>
<span id="cb13-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># import statsmodels.api as sm</span></span>
<span id="cb13-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># from matplotlib.backends.backend_pdf import PdfPages</span></span>
<span id="cb13-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># from google.colab import files</span></span>
<span id="cb13-11"></span>
<span id="cb13-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># # --- 1. КОНФИГУРАЦИЯ ---</span></span>
<span id="cb13-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pdf_filename = "Election_Analysis_2026_Final_Report.pdf"</span></span>
<span id="cb13-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># gist_url = "https://gist.githubusercontent.com/gregordimi/e0d3fe30e4f898c84ad25c38b39f6e44/raw/311a84fb7ce48c8bc47d61b359405d602b2aabd6/results2026.json"</span></span>
<span id="cb13-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># notebook_url = "https://colab.research.google.com/drive/1Zu_q3iuHCEs0OmtctdoCo3ef7LvgTeru?usp=sharing"</span></span>
<span id="cb13-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># author_url = "https://linkedin.com/in/grigordimitrov"</span></span>
<span id="cb13-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># election_date = pd.to_datetime('2026-04-19')</span></span>
<span id="cb13-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># PAGE_SIZE = (11, 8.5)</span></span>
<span id="cb13-19"></span>
<span id="cb13-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># def get_qr_image(url):</span></span>
<span id="cb13-21"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     qr = qrcode.QRCode(box_size=10, border=2)</span></span>
<span id="cb13-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     qr.add_data(url)</span></span>
<span id="cb13-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     qr.make(fit=True)</span></span>
<span id="cb13-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     return qr.make_image(fill_color="black", back_color="white")</span></span>
<span id="cb13-25"></span>
<span id="cb13-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># def add_footer(fig, page_num, total_pages):</span></span>
<span id="cb13-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     footer_text = f"Източник: Публични данни - Сайтове на агенции / Медии | Стр. {page_num} от {total_pages} | Забележка: Данните са събирани чрез бот, възможни са неточности"</span></span>
<span id="cb13-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     fig.text(0.5, 0.04, footer_text, ha='center', fontsize=8, color='grey', alpha=0.7)</span></span>
<span id="cb13-29"></span>
<span id="cb13-30"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># # --- 2. ПОДГОТОВКА НА ДАННИ ---</span></span>
<span id="cb13-31"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># party_cols = [c for c in df.columns if c in actual.index]</span></span>
<span id="cb13-32"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># cols = [c for c in df.columns if c not in ['Agency', 'Date', 'metadata', 'Не съм решил']]</span></span>
<span id="cb13-33"></span>
<span id="cb13-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># def calculate_metrics(row):</span></span>
<span id="cb13-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     diffs = row[party_cols] - actual[party_cols]</span></span>
<span id="cb13-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     return pd.Series({'MAE': np.abs(diffs).mean(), 'RMSE': np.sqrt((diffs**2).mean())})</span></span>
<span id="cb13-37"></span>
<span id="cb13-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># metrics_all_df = df.apply(calculate_metrics, axis=1)</span></span>
<span id="cb13-39"></span>
<span id="cb13-40"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ols_list = []</span></span>
<span id="cb13-41"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># for idx, row in df.iterrows():</span></span>
<span id="cb13-42"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     enc = row['metadata'].get('encoded', {})</span></span>
<span id="cb13-43"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     if not enc: continue</span></span>
<span id="cb13-44"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     ols_list.append({</span></span>
<span id="cb13-45"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         'Label': idx,</span></span>
<span id="cb13-46"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         'MAE': metrics_all_df.loc[idx, 'MAE'],</span></span>
<span id="cb13-47"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         'RMSE': metrics_all_df.loc[idx, 'RMSE'],</span></span>
<span id="cb13-48"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         'Is_Hybrid': 1 if enc.get('methodology') == 'hybrid' else 0,</span></span>
<span id="cb13-49"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         'Days_To_Election': (election_date - pd.to_datetime(enc.get('date'))).days,</span></span>
<span id="cb13-50"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         'Sample_Size': enc.get('sample_size', 0)</span></span>
<span id="cb13-51"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     })</span></span>
<span id="cb13-52"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># reg_df = pd.DataFrame(ols_list).dropna()</span></span>
<span id="cb13-53"></span>
<span id="cb13-54"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># X_reg = sm.add_constant(reg_df[['Is_Hybrid', 'Days_To_Election', 'Sample_Size']])</span></span>
<span id="cb13-55"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># model_mae = sm.OLS(reg_df['MAE'], X_reg).fit()</span></span>
<span id="cb13-56"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># model_rmse = sm.OLS(reg_df['RMSE'], X_reg).fit()</span></span>
<span id="cb13-57"></span>
<span id="cb13-58"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># target_parties = ['Прогресивна България', 'ГЕРБ', 'ПП-ДБ', 'ДПС', 'Възраждане']</span></span>
<span id="cb13-59"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># sorted_parties = actual[cols].sort_values(ascending=False).index</span></span>
<span id="cb13-60"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># total_p = 7 + len(target_parties)</span></span>
<span id="cb13-61"></span>
<span id="cb13-62"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># with PdfPages(pdf_filename) as pdf:</span></span>
<span id="cb13-63"></span>
<span id="cb13-64"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># # --- СТРАНИЦА 1: ЗАГЛАВИЕ (ADJUSTED) ---</span></span>
<span id="cb13-65"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     fig = plt.figure(figsize=PAGE_SIZE)</span></span>
<span id="cb13-66"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     plt.axis('off')</span></span>
<span id="cb13-67"></span>
<span id="cb13-68"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     # DRAFT воден знак</span></span>
<span id="cb13-69"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     plt.text(0.5, 0.96, 'DRAFT V2', ha='center', va='center', fontsize=40, fontweight='bold', color='red', alpha=0.7)</span></span>
<span id="cb13-70"></span>
<span id="cb13-71"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     # Заглавие и Подзаглавие</span></span>
<span id="cb13-72"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     plt.text(0.5, 0.88, 'Анализ на социологическата точност: Избори 2026', ha='center', fontsize=24, fontweight='bold', color='#003366')</span></span>
<span id="cb13-73"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     plt.text(0.5, 0.80, 'Статистически анализ на факторите, влияещи върху грешката', ha='center', fontsize=14, style='italic', color='#444')</span></span>
<span id="cb13-74"></span>
<span id="cb13-75"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     # Секция АВТОР И ЛИНКОВЕ</span></span>
<span id="cb13-76"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     # Използваме url= параметър за кликаемост в PDF</span></span>
<span id="cb13-77"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     plt.text(0.1, 0.70, f'Автор: Г. Д.', fontsize=12, fontweight='bold', color='#003366')</span></span>
<span id="cb13-78"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     plt.text(0.1, 0.67, 'LinkedIn Профил', fontsize=11, color='blue', url=author_url, bbox=dict(facecolor='none', edgecolor='none', pad=0))</span></span>
<span id="cb13-79"></span>
<span id="cb13-80"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     plt.text(0.1, 0.63, 'Източник на данни', fontsize=11, color='blue', url=gist_url)</span></span>
<span id="cb13-81"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     plt.text(0.1, 0.59, 'Код на анализа', fontsize=11, color='blue', url=notebook_url)</span></span>
<span id="cb13-82"></span>
<span id="cb13-83"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     plt.text(0.1, 0.54, f'Дата на анализ: {pd.Timestamp.now().strftime("%d.%m.%Y")}', fontsize=10, color='#666')</span></span>
<span id="cb13-84"></span>
<span id="cb13-85"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     # Блок с метрики</span></span>
<span id="cb13-86"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     metrics_note = ("• MAE (Средна абсолютна грешка): Линейно отклонение на прогнозата.\n"</span></span>
<span id="cb13-87"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#                     "• RMSE (Средноквадратична грешка): Подчертава големите индивидуални пропуски.\n"</span></span>
<span id="cb13-88"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#                     "• OLS Regression: Идентифицира кои фактори (метод, време, извадка) са статистически значими.")</span></span>
<span id="cb13-89"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     plt.text(0.1, 0.40, metrics_note, fontsize=10, bbox=dict(facecolor='#f0f0f0', alpha=0.5, edgecolor='none', pad=5))</span></span>
<span id="cb13-90"></span>
<span id="cb13-91"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     # QR Кодове (Запазваме ги като визуален елемент)</span></span>
<span id="cb13-92"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     ax_qr0 = fig.add_axes([0.20, 0.12, 0.15, 0.15]); ax_qr0.imshow(get_qr_image(author_url), cmap='gray'); ax_qr0.axis('off'); ax_qr0.set_title("Автор", fontsize=8)</span></span>
<span id="cb13-93"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     ax_qr1 = fig.add_axes([0.42, 0.12, 0.15, 0.15]); ax_qr1.imshow(get_qr_image(notebook_url), cmap='gray'); ax_qr1.axis('off'); ax_qr1.set_title("Код", fontsize=8)</span></span>
<span id="cb13-94"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     ax_qr2 = fig.add_axes([0.64, 0.12, 0.15, 0.15]); ax_qr2.imshow(get_qr_image(gist_url), cmap='gray'); ax_qr2.axis('off'); ax_qr2.set_title("Данни", fontsize=8)</span></span>
<span id="cb13-95"></span>
<span id="cb13-96"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     add_footer(fig, 1, total_p)</span></span>
<span id="cb13-97"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     pdf.savefig(fig, dpi=300, bbox_inches='tight'); plt.close()</span></span>
<span id="cb13-98"></span>
<span id="cb13-99"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     # --- СТРАНИЦА 6: МАТРИЦА НА ДАННИ ---</span></span>
<span id="cb13-100"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     fig = plt.figure(figsize=PAGE_SIZE)</span></span>
<span id="cb13-101"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     sns.heatmap(df[sorted_parties], annot=True, fmt='.1f', cmap='YlGnBu', annot_kws={"size": 8}, cbar_kws={'shrink': 0.8})</span></span>
<span id="cb13-102"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     plt.title('Матрица на данните: Всички прогнози (%)', fontsize=16, fontweight='bold')</span></span>
<span id="cb13-103"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     plt.xticks(rotation=45, ha='right', fontsize=9); plt.yticks(fontsize=8)</span></span>
<span id="cb13-104"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     plt.tight_layout(rect=[0.05, 0.08, 0.95, 0.95])</span></span>
<span id="cb13-105"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     add_footer(fig, 6, total_p)</span></span>
<span id="cb13-106"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     pdf.savefig(fig, dpi=300); plt.close()</span></span>
<span id="cb13-107"></span>
<span id="cb13-108"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     # --- СТРАНИЦА 2: RMSE СРЕЩУ MAE ---</span></span>
<span id="cb13-109"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     metrics_summary = metrics_all_df.sort_values('RMSE')</span></span>
<span id="cb13-110"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     fig, ax = plt.subplots(figsize=PAGE_SIZE)</span></span>
<span id="cb13-111"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     y_indices = np.arange(len(metrics_summary))</span></span>
<span id="cb13-112"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     ax.barh(y_indices - 0.17, metrics_summary['MAE'], 0.35, label='MAE', color='#3498db', alpha=0.8, edgecolor='black')</span></span>
<span id="cb13-113"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     ax.barh(y_indices + 0.17, metrics_summary['RMSE'], 0.35, label='RMSE', color='#e74c3c', alpha=0.8, edgecolor='black')</span></span>
<span id="cb13-114"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     ax.set_yticks(y_indices); ax.set_yticklabels(metrics_summary.index); ax.invert_yaxis()</span></span>
<span id="cb13-115"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     ax.set_title('Сравнение на точността по агенции\n', fontsize=16, fontweight='bold')</span></span>
<span id="cb13-116"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     ax.text(0.5, 1.02, 'Агрегирани стойности на MAE и RMSE спрямо официалния резултат', transform=ax.transAxes, ha='center', fontsize=11, color='#555')</span></span>
<span id="cb13-117"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     ax.legend(); ax.grid(axis='x', linestyle='--', alpha=0.3)</span></span>
<span id="cb13-118"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     plt.tight_layout(rect=[0.05, 0.08, 0.95, 0.92])</span></span>
<span id="cb13-119"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     add_footer(fig, 2, total_p)</span></span>
<span id="cb13-120"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     pdf.savefig(fig, dpi=300); plt.close()</span></span>
<span id="cb13-121"></span>
<span id="cb13-122"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     # --- СТРАНИЦА 3: OLS КОЕФИЦИЕНТИ (С ТИТЛИ И ПОДЗАГЛАВИЯ) ---</span></span>
<span id="cb13-123"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     fig, (ax1, ax2) = plt.subplots(1, 2, figsize=PAGE_SIZE, sharey=True)</span></span>
<span id="cb13-124"></span>
<span id="cb13-125"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     model_mae.params[1:].plot(kind='barh', xerr=model_mae.bse[1:], color='#3498db', ax=ax1, alpha=0.8, edgecolor='black')</span></span>
<span id="cb13-126"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     ax1.axvline(0, color='red', linestyle='--', linewidth=1)</span></span>
<span id="cb13-127"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     ax1.set_title('Въздействие върху MAE\n', fontsize=13, fontweight='bold')</span></span>
<span id="cb13-128"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     ax1.text(0.5, 1.02, 'Как факторите променят линейната грешка (%)', transform=ax1.transAxes, ha='center', fontsize=9, color='#555')</span></span>
<span id="cb13-129"></span>
<span id="cb13-130"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     model_rmse.params[1:].plot(kind='barh', xerr=model_rmse.bse[1:], color='#e74c3c', ax=ax2, alpha=0.8, edgecolor='black')</span></span>
<span id="cb13-131"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     ax2.axvline(0, color='red', linestyle='--', linewidth=1)</span></span>
<span id="cb13-132"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     ax2.set_title('Въздействие върху RMSE\n', fontsize=13, fontweight='bold')</span></span>
<span id="cb13-133"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     ax2.text(0.5, 1.02, 'Тежест на факторите при големи отклонения', transform=ax2.transAxes, ha='center', fontsize=9, color='#555')</span></span>
<span id="cb13-134"></span>
<span id="cb13-135"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     plt.suptitle('СТАТИСТИЧЕСКА ЗНАЧИМОСТ НА ФАКТОРИТЕ (OLS)', fontsize=16, fontweight='bold', y=0.96)</span></span>
<span id="cb13-136"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     # Свиване на графиките надолу чрез rect [left, bottom, right, top]</span></span>
<span id="cb13-137"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     plt.tight_layout(rect=[0.05, 0.12, 0.95, 0.88])</span></span>
<span id="cb13-138"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     add_footer(fig, 3, total_p)</span></span>
<span id="cb13-139"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     pdf.savefig(fig, dpi=300); plt.close()</span></span>
<span id="cb13-140"></span>
<span id="cb13-141"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     # --- СТРАНИЦА 4: SIDE-BY-SIDE ДИНАМИКА (С ТИТЛИ И ПОДЗАГЛАВИЯ) ---</span></span>
<span id="cb13-142"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     fig, (ax3, ax4) = plt.subplots(1, 2, figsize=PAGE_SIZE)</span></span>
<span id="cb13-143"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     titles = ['MAE Dynamics', 'RMSE Dynamics']</span></span>
<span id="cb13-144"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     subtitles = ['Линейно отклонение във времето', 'Квадратично наказание за големи грешки']</span></span>
<span id="cb13-145"></span>
<span id="cb13-146"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     for ax, metric, color, title, sub in zip([ax3, ax4], ['MAE', 'RMSE'], ['#3498db', '#e74c3c'], titles, subtitles):</span></span>
<span id="cb13-147"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         sns.scatterplot(data=reg_df, x='Days_To_Election', y=metric, hue='Is_Hybrid', size='Sample_Size',</span></span>
<span id="cb13-148"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#                         sizes=(100, 700), palette={0: '#3498db', 1: '#e74c3c'}, alpha=0.6, edgecolor='black', ax=ax)</span></span>
<span id="cb13-149"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         for _, row in reg_df.iterrows():</span></span>
<span id="cb13-150"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#             ax.text(row['Days_To_Election'], row[metric], s=row['Label'], fontsize=7, rotation=45, ha='left', va='bottom')</span></span>
<span id="cb13-151"></span>
<span id="cb13-152"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         ax.invert_xaxis(); ax.grid(True, linestyle=':', alpha=0.6)</span></span>
<span id="cb13-153"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         ax.set_title(f'{title}\n', fontsize=13, fontweight='bold')</span></span>
<span id="cb13-154"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         ax.text(0.5, 1.02, sub, transform=ax.transAxes, ha='center', fontsize=9, color='#555')</span></span>
<span id="cb13-155"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         ax.get_legend().remove()</span></span>
<span id="cb13-156"></span>
<span id="cb13-157"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     handles, labels = ax4.get_legend_handles_labels()</span></span>
<span id="cb13-158"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     fig.legend(handles, labels, title='Метод (0=F2F, 1=Hybrid)', loc='center right', bbox_to_anchor=(0.98, 0.5))</span></span>
<span id="cb13-159"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     plt.suptitle('ХРОНОЛОГИЧНО РАЗПРЕДЕЛЕНИЕ НА ТОЧНОСТТА', fontsize=16, fontweight='bold', y=0.96)</span></span>
<span id="cb13-160"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     # Свиване на графиките надолу</span></span>
<span id="cb13-161"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     plt.tight_layout(rect=[0.05, 0.1, 0.88, 0.88])</span></span>
<span id="cb13-162"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     add_footer(fig, 4, total_p)</span></span>
<span id="cb13-163"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     pdf.savefig(fig, dpi=300); plt.close()</span></span>
<span id="cb13-164"></span>
<span id="cb13-165"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     # --- СТРАНИЦА 5: МАТРИЦА НА ОТКЛОНЕНИЯТА ---</span></span>
<span id="cb13-166"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     residuals = df[cols].sub(actual[cols], axis=1)</span></span>
<span id="cb13-167"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     fig = plt.figure(figsize=PAGE_SIZE)</span></span>
<span id="cb13-168"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     sns.heatmap(residuals[sorted_parties], annot=True, fmt='.1f', cmap='RdBu_r', center=0, annot_kws={"size": 8}, cbar_kws={'shrink': 0.8})</span></span>
<span id="cb13-169"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     plt.title('Матрица на отклоненията (Прогноза - Реалност)', fontsize=16, fontweight='bold')</span></span>
<span id="cb13-170"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     plt.xticks(rotation=45, ha='right', fontsize=9); plt.yticks(fontsize=8)</span></span>
<span id="cb13-171"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     plt.tight_layout(rect=[0.05, 0.08, 0.95, 0.95])</span></span>
<span id="cb13-172"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     add_footer(fig, 5, total_p)</span></span>
<span id="cb13-173"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     pdf.savefig(fig, dpi=300); plt.close()</span></span>
<span id="cb13-174"></span>
<span id="cb13-175"></span>
<span id="cb13-176"></span>
<span id="cb13-177"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     # --- СТРАНИЦИ 7-N: ТРЕНДОВЕ ---</span></span>
<span id="cb13-178"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     curr_p = 7</span></span>
<span id="cb13-179"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     trend_df = df.sort_values('Date')</span></span>
<span id="cb13-180"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     for party in target_parties:</span></span>
<span id="cb13-181"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         if party in trend_df.columns:</span></span>
<span id="cb13-182"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#             fig = plt.figure(figsize=PAGE_SIZE)</span></span>
<span id="cb13-183"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#             plt.plot(trend_df.index, trend_df[party], marker='o', color='#1f77b4', linewidth=2)</span></span>
<span id="cb13-184"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#             plt.axhline(y=actual[party], color='#d62728', linestyle='--', linewidth=3, label=f'Реалност ({actual[party]}%)')</span></span>
<span id="cb13-185"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#             plt.title(f'Тренд на прогнозите: {party}', fontsize=16, fontweight='bold')</span></span>
<span id="cb13-186"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#             plt.xticks(rotation=45, ha='right', fontsize=8); plt.legend(); plt.grid(alpha=0.3)</span></span>
<span id="cb13-187"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#             plt.tight_layout(rect=[0.05, 0.08, 0.95, 0.95])</span></span>
<span id="cb13-188"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#             add_footer(fig, curr_p, total_p)</span></span>
<span id="cb13-189"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#             pdf.savefig(fig, dpi=300); plt.close()</span></span>
<span id="cb13-190"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#             curr_p += 1</span></span>
<span id="cb13-191"></span>
<span id="cb13-192"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     # --- ФИНАЛНА СТРАНИЦА: ЗАКЛЮЧЕНИЯ ---</span></span>
<span id="cb13-193"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     fig = plt.figure(figsize=PAGE_SIZE)</span></span>
<span id="cb13-194"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     plt.axis('off')</span></span>
<span id="cb13-195"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     plt.text(0.05, 0.92, 'Заключение и изводи от анализа', fontsize=20, fontweight='bold', color='#003366')</span></span>
<span id="cb13-196"></span>
<span id="cb13-197"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     y_pos = 0.82</span></span>
<span id="cb13-198"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     conclusion_blocks = [</span></span>
<span id="cb13-199"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         ("• Системен пропуск:", "Всички агенции подцениха победителя (Прогресивна България) с над 10% средно отклонение.", True),</span></span>
<span id="cb13-200"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         ("", "Всички агенции надцениха установените играчи (ГЕРБ, ДПС, Възраждане) в различна степен.", True),</span></span>
<span id="cb13-201"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         ("• Методология:", "Необходима е ревизия на моделите за разпределение на гласовете на нерешилите избиратели.", False),</span></span>
<span id="cb13-202"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         ("", "Необходима е критична ревизия на източниците и структурирането на извадката.", True),</span></span>
<span id="cb13-203"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         ("• Информационна хигиена:", "Ефирът е пълен с демографски, психографски и поведенчески разпределения на вота, към които", False),</span></span>
<span id="cb13-204"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         ("", "трябва да се подходи със скептицизъм, имайки предвид мащаба на анализираните отклонения.", False),</span></span>
<span id="cb13-205"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         ("", "Анализи на по-малки кохорти (напр. от типа коя партия е донор на гласоподаватели)", False),</span></span>
<span id="cb13-206"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         ("", "носят риск да са значително по-неточни.", False),</span></span>
<span id="cb13-207"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         ("• Забележка:", "Нормализирането на толкова голям набор от изследвания изисква задълбочена работа.", False),</span></span>
<span id="cb13-208"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         ("", "Този анализ е по-скоро отправна точка за по-задълбочени бъдещи мета-анализи, целящи повишаване на прогнозната сила.", False),</span></span>
<span id="cb13-209"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         ("", "Най-належащата задача би била ръчното преглеждане и коригиране на входящите данни.", False),</span></span>
<span id="cb13-210"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     ]</span></span>
<span id="cb13-211"></span>
<span id="cb13-212"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     for header, detail, add_space in conclusion_blocks:</span></span>
<span id="cb13-213"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         if header: plt.text(0.05, y_pos, header, fontsize=13, fontweight='bold', color='#003366'); y_pos -= 0.05</span></span>
<span id="cb13-214"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         plt.text(0.07, y_pos, detail, fontsize=12, color='#333333'); y_pos -= 0.05</span></span>
<span id="cb13-215"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#         if add_space: y_pos -= 0.02</span></span>
<span id="cb13-216"></span>
<span id="cb13-217"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     rect = plt.Rectangle((0.03, 0.15), 0.94, 0.80, linewidth=1, edgecolor='#cccccc', facecolor='#f9f9f9', alpha=0.3, zorder=-1)</span></span>
<span id="cb13-218"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     fig.patches.append(rect)</span></span>
<span id="cb13-219"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     add_footer(fig, total_p, total_p)</span></span>
<span id="cb13-220"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     pdf.savefig(fig, dpi=300, bbox_inches='tight'); plt.close()</span></span>
<span id="cb13-221"></span>
<span id="cb13-222"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># print(f"✅ Докладът е генериран успешно: {pdf_filename}")</span></span>
<span id="cb13-223"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># files.download(pdf_filename)</span></span></code></pre></div></div>
</details>
</div>


</section>
</section>
</section>

 ]]></description>
  <category>sociology</category>
  <guid>https://gregordimi.com/posts/election-sociology-analysis-2026/</guid>
  <pubDate>Thu, 23 Apr 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>The mighty Rodopa mountain 2023</title>
  <dc:creator>Grigor Dimitrov</dc:creator>
  <link>https://gregordimi.com/posts/persenk-2023/</link>
  <description><![CDATA[ 






<section id="the-mighty-rodopa-mountain-2023" class="level1">
<h1>The Mighty Rodopa Mountain 2023</h1>
<p>The year is 2023, and after a year of preparation and the unsuccessful but very insightful attempt of 2022, I am ready to face the Wild Boar Ultra again. This time I was more prepared as I knew what to expect. I was more confident and ready to face the challenge. The weather was perfect, and the mountain was calling me. I was ready to face the challenge.</p>
<p><img src="https://gregordimi.com/posts/persenk-2023/image14.jpg" alt="Rodopa" width="600"></p>
<blockquote class="blockquote">
<p>Except that I wasn’t that ready</p>
</blockquote>
<p><img src="https://gregordimi.com/posts/persenk-2023/image11.jpg" alt="Rodopa" width="600"></p>
<p>I have fixed everything that I thought was wrong with my previous attempt. I had better gear, better nutrition, and all of the minor hiccups like headlight, backpack organization, and so on were fixed. I had gained some weight, but I was confident that it wouldn’t be a problem.</p>
<blockquote class="blockquote">
<p>A few extra kilos after 50 kilometers feels like carrying one more person on your back</p>
</blockquote>
<p><img src="https://gregordimi.com/posts/persenk-2023/image12.jpg" alt="Rodopa" width="600"></p>
<p>From the start, I knew I was in trouble as my HR was substantially higher than it should be if I wanted to sustain it for 100 km. After the second major descent, I started feeling a creeping pain in my right knee which was slowly turning into a sharp pain.</p>
<blockquote class="blockquote">
<p>So I stopped at the 50 km mark</p>
</blockquote>
<p><img src="https://gregordimi.com/posts/persenk-2023/image15.jpg" alt="Rodopa" width="600"></p>
<p>I was feeling great, with no extraordinary pain, so I got a beer and started thinking about how to defeat this race next year. Here’s the plan:</p>
<ol type="1">
<li>Skip one year</li>
<li>Go down to 77 kilos</li>
<li>Train elevation gain</li>
<li>Train descent</li>
<li>Train terrains</li>
<li>Add strength training for foot arches, ankles, knees, and hips</li>
<li>Make a dry run and plan every segment of the race</li>
<li>Take the course effortlessly</li>
</ol>
<p><img src="https://gregordimi.com/posts/persenk-2023/image13.jpg" alt="Rodopa" width="600"></p>
<p>So let’s celebrate not a single equipment failure or injury in 2023.</p>


</section>

 ]]></description>
  <category>ultra</category>
  <guid>https://gregordimi.com/posts/persenk-2023/</guid>
  <pubDate>Wed, 23 Aug 2023 00:00:00 GMT</pubDate>
</item>
<item>
  <title>The mighty Rodopa mountain 2022</title>
  <dc:creator>Grigor Dimitrov</dc:creator>
  <link>https://gregordimi.com/posts/persenk-2022/</link>
  <description><![CDATA[ 






<section id="the-mighty-rodopa-mountain" class="level1">
<h1>The mighty Rodopa mountain</h1>
<p>What did I learn from attempting to run the wild boar 100k race at Persenk ultra?</p>
<p><img src="https://gregordimi.com/posts/persenk-2022/image1.jpg" alt="image_tooltip" width="600"></p>
<p>Back in December, I was having coffee with a friend who announced he was going to attempt a 160k Persenk Ultra mountain race. Under the festive influence of new year’s eve and boosted by two double espressos the initiative seemed very appealing and without hesitation, I let the impulse lead and enrolled in the challenge with an early bird ticket.</p>
<p>The conditions were clear, 110 km in the Robopa mountain in a familiar area. The almost impossible challenge for me yet “almost” was the key. Also, the ticket comes with an option to postpone the challenge by one year with no hassle.</p>
<p>I’ve been running for about 10 years now, and I am not very good at it. It took me 5 to learn how to hold my form and I am still developing it. In December 2019 I insured myself running on the slopes of Madeira island and the annoying shin splint injury still appears whenever I attempt to increase the mileage. I also have flat feet and whenever I exert too much pressure over prolonged periods it takes a toll on my knees.</p>
<p>For the Wild boar race I’ve been preparing since the Spring, unfortunately in Berlin, there’s only a flat surface. My preparation included running and walking for 10k per day for about 6 months. In addition, I’ve been doing intense gym sessions for my overall fitness. For the last 2 months, I’ve been doing one cardio session and one strength session daily. I’ve never felt better and healthier in my life.</p>
<p>Before the race. I didn’t get my diet right before the race so I had to take some laxatives. I haven’t taken magnesium sulfate aka English salt before and honestly, it’s pretty of an effect. Apart from the main impact of attracting water to your intestines and causing rapid defecation, it had a substantial relaxing effect on one’s muscles and mind. I slept like a baby while otherwise being quite anxious in anticipation of similar performances. The drawback is that it sucks out all the water and salts from your body which I was about to find the next day.</p>
<p>On the race day, my father took me from Plovdiv to Asenovgrad where the start of the race took place. I met my friend Anton and his parents and we had to chat about stuff for an hour before the start. There were a lot of special supplements at the start. I didn’t eat a lot that day since I didn’t have the correct food at home.</p>
<p><img src="https://gregordimi.com/posts/persenk-2022/image2.jpg" alt="image_tooltip" width="600"></p>
<p>Finally 6 pm and the start, 37 degrees celsius and horrible denivelation at the start for the first 15k the elevation is 1500m. I was completely soaked at the first kilometre and puked. I felt so bad that I thought about quitting while still being meters after the start. Demotivating. The laxatives rippled through my body and had to do the business in the bushes. Not being able to clean me with water gave me the most horrible rash I’ve ever got and a burning sensation on my butt for the next 15 hours.</p>
<p><img src="https://gregordimi.com/posts/persenk-2022/image3.jpg" alt="image_tooltip" width="600"></p>
<p>Yet finally some good news, after sweating dry, pooping and puking at the beginning. I felt amazing and regained my powers. The sun went off and the temperature dropped. And one hour into the race I was finally ready to start! The climb was tough but doable. I felt I could do this for days with no issues at all. The light went completely off and here we are in the pitch dark at 9 pm the temperature is amazingly little below 20 degrees. There’s a grass surface which is very gentle on the body and I am enjoying it fully.</p>
<p><img src="https://gregordimi.com/posts/persenk-2022/image4.jpg" alt="image_tooltip" width="600"></p>
<p>At 18km I am at the first stop having a chat with the organizers, really nice people. To my surprise the food there was sufficient and there was no need to carry so much food with me. After spending way too much time there I headed to the next chapter. The descent. The horrible 10-kilometre descent took a huge toll on my body, it was very appealing to attempt to run but that’s an absolute no go for the next time. Having to descend 1000m within 10 kilometres proved to be the most difficult part of the race for me. My right knee started making cracking noises and bending in weird directions.</p>
<p>My first tandem appeared and we joined forces. Having casual chats was nice, and it felt safer to be next to someone who did this for 10 consecutive years. Having to know that he succeeded only every next time was very interesting. The most useful part of the tandem was when my headlamp went off in the middle of the night and I couldn’t find the spare one.</p>
<p>I quickly began to realize that I will not be able to finish the race at about 40k. My knee was not behaving as it should on the descents and I was fearing permanent damage. Knowing the exact reason for this, I comforted myself with the thought that I can fix it and I will be more successful next year. Yet I decided to push through the pain for several more hours, just to see what else will happen.</p>
<p>The morning came and it brought fresh powers, I wasn’t sleepy at all. I am not a stranger to insomnia and I am generally familiar with the lack of sleep. The ibuprofen appeared in the picture as well. I felt so empowered by the lack of pain and the powers of the daylight that I began fantasizing about finishing the race. At this point, I was way behind the time so I had to speed up. I started offsetting the pain in the right knee by stepping only on the outer side of my feet which completely eradicated the pain. The tracks from heavy trucks in the mud were very helpful since I could step on the small right-sided slope which was exactly the form that I needed to keep going. My new goal was to reach Orehovo at the cut-off time, take a shower and decide whether to continue or not.</p>
<p><img src="https://gregordimi.com/posts/persenk-2022/image5.jpg" alt="image_tooltip" width="600"></p>
<p>So I did after exactly 15 hours and about 68 kilometres I managed to reach the stop right before elimination time. Yet the prospect of having to finish another 45 kilometres didn’t seem rational given the list of improvement points which I assembled in my head.</p>
<p><img src="https://gregordimi.com/posts/persenk-2022/image6.jpg" alt="image_tooltip" width="600"></p>
<p>So here it is:</p>
<ol type="1">
<li>Do something about the flat feet. It’s impossible to run like this. The correction should come either from exercise or insoles. The flat feet lead stepping inwards not causing any problems in normal life but during prolonged efforts, it impacts the geometry of the knees. Fix it.</li>
</ol>
<p><img src="https://gregordimi.com/posts/persenk-2022/image7.jpg" alt="image_tooltip" width="600"></p>
<ol start="2" type="1">
<li>I regularly walk in very comfortable sneakers and the skin on my feet is very gentle, making the blisters horrible. Figure out how to avoid blisters but strengthen the skin.</li>
</ol>
<p><img src="https://gregordimi.com/posts/persenk-2022/image8.jpg" alt="image_tooltip" width="600"></p>
<ol start="3" type="1">
<li>Choose your own pace. The group was mostly running at the beginning which wasn’t necessary, I’d rather have this energy later in the race and not spend it on jogging at the beginning.</li>
<li>Learn the terrain, learn the path, learn the segments and have an execution plan. Ideally before the race next year I will do the path at least once before the race possible in the spring.</li>
<li>Body weight. Consider if losing body weight would be advantageous.</li>
<li>Choose where to run based on:
<ol type="1">
<li><p>Current energy levels</p></li>
<li><p>Terrain surface</p></li>
<li><p>Slope</p>
<p>I made the mistake to run on downward slopes with very weird surfaces. Avoid running on big rocks which are not attached to the surface. Ideally know the exact terrain and have a plan of where to run and where to walk.</p></li>
</ol></li>
</ol>
<p>Gear</p>
<ol start="7" type="1">
<li>Backpack type. I had a 15l backpack bigger than the one carried by most of the participants. I intentionally wanted to have a big backpack to minimize the risks of getting in trouble in case I get lost in the woods. I carried a First Aid kit and a windshield blanket. Additional litre of water and lots of food.</li>
<li>Backpack organization. My backpack was so tightly packed that I wasn’t able to find anything inside. Figure out what is the optimal distribution of things inside the bag so I have easy access to everything.</li>
</ol>
<p><img src="https://gregordimi.com/posts/persenk-2022/image9.jpg" alt="image_tooltip" width="600"></p>
<ol start="9" type="1">
<li>Headlamp. My amazon headlamps were BS and not effective, get a decent one which lasts at least 30 hours. The best case would be a lamp chargeable with some battery inside the backpack or on a belt.</li>
<li>Get a belt.</li>
<li>My compression socks were too warm and too tight. The compression socks are an absolute necessity but I need better and thinner ones.</li>
<li>Gaiters. I had to empty my shoes multiple times from dust and small particles. Lighty trail running gaiters would protect me.</li>
<li>GPS watch. Using my running app on the phone is not an option (Hello). Strava is an awesome app but it does not offer terrain insights, distance, elevation etc. etc. which are available on more specialized gear.</li>
<li>Bottoms. I was using running shorts yet tight leggings would be a better choice since they would prevent friction between the legs.</li>
<li>Tops. My top was perfectly fine, so people who had a pro top seemed more comfortable after half of the race. Need to investigate.</li>
<li>Poles. Train walking with poles. There are many techniques and I can also invent some. However, race day is not a day for clearing the technique. Go with a proper technique.</li>
<li>Poles. Get nicer poles. I lost the soft part of my poles very early in the race and the iron pointers were good only for softer terrain. When I used them on asphalt it proceeded with a very high impact which didn’t feel nice on the hands.</li>
</ol>
<p>Food, supplements and nutrition</p>
<ol start="18" type="1">
<li>Figure out the food before the race.</li>
<li>Do not drink alcohol at least a week before the race.</li>
<li>Salt during the race. I’ve had some hydration packs. They were extremely effective once ingested yet, the hassle of the preparation was way too much, I need those in solid pill form.</li>
<li>Specialized energy gels are amazing, find out where to acquire those. The ones with BCAA amino acids and high caffeine does wonder. The ones with high salt content can replace the salt pills.</li>
<li>Ibuprofen at the later stage of the race does wonders.</li>
<li>Magnesium is necessary to avoid cramps</li>
<li>Vaseline was necessary against the rash.</li>
<li>Sunscreen cream.</li>
<li>Get some proper recovery and something to look forward to after the race.</li>
</ol>
<p><img src="https://gregordimi.com/posts/persenk-2022/image10.jpg" alt="image_tooltip" width="600"></p>


</section>

 ]]></description>
  <category>ultra</category>
  <guid>https://gregordimi.com/posts/persenk-2022/</guid>
  <pubDate>Tue, 23 Aug 2022 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Conjoint analysis - survey limitations</title>
  <dc:creator>Grigor Dimitrov</dc:creator>
  <link>https://gregordimi.com/posts/conjoint-analysis-survey-limitations/</link>
  <description><![CDATA[ 






<p>Summary: When people are asked questions in surveys, they sometimes give untrue answers. This happens because they might not be motivated to answer truthfully, or they might not be paying attention to the questions. survey designers have come up with ways to try to get people to answer truthfully, such as by asking them questions that are very unlikely to happen, or by giving them rewards for good answers. However, there is still no sure way to make sure that people will answer truthfully.</p>
<section id="intro" class="level3">
<h3 class="anchored" data-anchor-id="intro">Intro</h3>
<p>Practitioners have defined several systematic behaviors which potentially lead to low-quality data in online data collection <sup>1</sup>, <sup>2</sup>. Namely, cross-cultural factors, untruthfulness, speeding, question format, and sample quality have been identified to have a negative impact on data quality, thus, causing noise in the data rather than variance.</p>
<p>One of the major limitations of online opinion taking, and in particular preference measurement is the lack of motivation by respondents <sup>3</sup>, which can result in reduced respondents engagement, hence untruthful answers. For the purpose of this paper, I will further elaborate on respondents’ untruthfulness, engagement, and motivation.</p>
<p>The hypothetical nature in which typically conjoint studies are executed questions the extent to which they are able to reveal the true consumer preferences <sup>4</sup>. When respondents are not incentivized to reveal their true preferences and the data is collected in hypothetical settings, weaker external validity is observed <sup>5</sup>. Respondents have little or no incentive to reveal their true preference or to be mindful about their answers in hypothetical settings <sup>6</sup>. Economic theory suggests that if economic agents believe their answers will have an impact on decisions made by businesses or governments for outcomes that the agents care about, they should respond in such a way as to maximize their payoffs and welfare <sup>7</sup>. However, due to the hypothetical nature of the surveys, in most conjoint studies respondents may misinterpret their preferences and the study may not yield truthful answers. Though hypothetical techniques are found to perform fine in many domains <sup>8</sup>; <sup>9</sup>; <sup>10</sup>; <sup>11</sup>, recent conjoint studies reveal that incentive-aligned conjoint is superior to hypothetical conjoint in out-of-sample prediction, and it is more engaging and motivating <sup>12</sup>; <sup>13</sup>; <sup>14</sup>.</p>
<p>Typically, practitioners apply different rules of identifying “bad quality” respondents and eliminating them when analyzing the data, such as using misdirect questions (or traps). For example, <sup>15</sup> recognize untruthfulness by asking respondents several questions with an extremely low incidence rate and asking questions that have known distribution across the population. The authors argue that based on the score estimated from these questions, it is possible for researchers to screen out respondents and thus, remove respondents that do not have carefully considered answers. Speeding is also a quality measure often applied to achieve the necessary data quality. <sup>16</sup> claim that 85% of the respondents are speeding at some point of the questionnaires, which makes it impossible to exclude these responses from the survey. The authors argue that speeding is an “epidemic” in the online survey world and it is a generic issue that holds the potential to cause the biggest amount of noise in the data. In their paper, the authors divided the sample into two categories, above and below the average length of the interview. The analysis of the comparison of both groups showed that respondents in the group below average times account for +/-6.2% higher variance on average. As expected, with the progression of the survey the variance increases from 4% at the beginning to 8% at the end. The authors do not bind themselves to the claim that this variance is a source of noise in the data, however, one could speculate that the consequence of speeding is low-quality data.</p>
<p>The recent technological advancements allowed for increased accessibility to respondents <sup>17</sup>. But this comes with a trade-off, as there has been decreased attentiveness and patience as respondents are easily distracted. With the aid of technology, there have been efforts to engage respondents with the task using improved interfaces, survey designs, question formats, and even game-like environments (see <sup>18</sup> for discussion). Hence, practitioners have attempted to tackle the disengagement by incorporating intuitive mechanisms in their survey designs. These mechanisms indicate only “suggestive evidence” of underlying issues and determination that respondents are “behaving badly”. Despite those attempts, the biggest source of bad data is still the disengaged respondent.</p>
<p>The academia also recognized the lack of motivation as a key limitation concerning preference measurement methods <sup>19</sup>; <sup>20</sup>; <sup>21</sup>; <sup>22</sup>. However, academia has investigated the source of these problems in order to provide solid solutions. Respondents are putting significantly less cognitive effort when making survey choices compared to real-life decisions, which leads to poor out-of-sample predictions <sup>23</sup>. To increase the level of involvement, based on insights from experimental economics, some scholars approached preference measurement issues applying incentive-compatible mechanisms. Experimental economists claim that using incentive-compatible methods should induce truth-telling as monetary incentives dominate over other factors. Hence, respondents are encouraged to reveal their true preferences to maximize their final payoff <sup>24</sup>. In their Induced value theory, <sup>25</sup> define 5 percepts, 3 of which are sufficient conditions for incentive compatible behavior. The first principle is referred to as saliency, in other words, participants’ final monetary payoff should depend on their performance, where better performance leads to a better outcome. The saliency principle is also related to the non satiation principle, claiming that “utility is a monotone increasing function of monetary reward”, or simply put “the more the better”. The third principle is dominance. To assure control over the preference, the final payoff for the exerted cognitive efforts should dominate the subjective costs of participation. When those conditions are met, incentive-compatible methods should yield truthful answers.</p>
<p>Recent studies on adopting incentive-compatible mechanisms to conjoint have shown that incentive-compatible mechanisms can result in boosting respondents’ motivation leading to respondents providing truthful answers.</p>
</section>
<section id="incentive-aligned-conjoint" class="level3">
<h3 class="anchored" data-anchor-id="incentive-aligned-conjoint">Incentive aligned conjoint</h3>
<p>A general concern amongst practitioners when using conjoint methodologies is that respondents are not motivated during the survey and that choices made during the conjoint exercise differ from real-life purchasing choices <sup>26</sup>. <sup>27</sup> compared the out-of-sample predictions for two conjoin designs; the first adopted the traditional hypothetical setting, while the second used Chinese dinner special as a context in which respondents had a positive chance of receiving a preferred alternative from each choice set at the end of the experiment. Results showed that the external validity is increased compared to a setting where respondents hypothetically provide answers for each of the choice tasks.</p>
<p>The authors find the most relevant principle to conjoint analysis to be saliency. In practice, respondents are given a flat participation fee, which doesn’t induce honest responses. Hence, saliency hasn’t been satisfied as respondents are neither rewarded nor penalized based on their performance. Providing respondents with a flat participation fee cannot motivate them enough to carefully evaluate every given choice in the conjoint surveys, resulting in noise in the data. Hence, there is no reason for researchers to expect that predictions based on the survey data from non-salient responses will make valid out-of-sample predictions. In other words, respondents’ stated preference will not be consistent with their revealed preference <sup>28</sup>. The main disadvantage of this experiment, however, is that the researcher should have available all alternatives from each choice set.</p>
<p><sup>29</sup> created a mechanism that does not require changes in the existing conjoint methodologies and allows for situations in which the researcher has available a few alternatives of the product. Respondents are offered the available alternatives as potential rewards. The method incorporates BDM <sup>30</sup> procedure to compare subjects’ valuations to a randomly generated price, the optimal strategy for a participant being to state his or her true WTP. If the bid is higher, the subject pays the randomly generated price and gets the item. If the bid is lower than the elicited price, the subject doesn’t pay and receives nothing. The method works in four steps. First, participants complete a standard conjoint exercise. Afterward, the experimenter shows them a real product that they could potentially purchase. By not revealing the product in hand prior to the conjoint exercise (as it is of limited availability), respondents’ preferences are not biased. After the product, if being shown, the interred WTP is calculated. Finally, using BDM it is determined whether a participant can purchase the real product or not. The drawback of this method, however, is that by using the BDM mechanism, respondents have the chance to purchase the real product with the majority of the amount of money coming from the difference between the inferred price and the randomly drawn price. Hence, there might be a difference when in real life respondents need to use their own money. Moreover, the design cannot be applied to new goods as it requires an alternative to be present when performing the study and one of the main applications of conjoint analysis is for new product development.</p>
<p><sup>31</sup>, proposed an incentive-aligned conjoint method that allows respondents to update each attribute and configure their own product. When upgrading attributes, respondents state their willingness to pay per upgrade. The BDM mechanism is adopted here as well, to ensure that the best option for respondents is to truthfully state their willingness to pay. At the end of the experiment, respondents receive their upgraded product. The authors found that the method can significantly outperform the standard conjoint study. The drawback of this study is that again, researchers need to have the product available.</p>
<p><sup>32</sup> argued that those methods “may not increase involvement to a level of real-life purchasing decisions”. The reasoning is that respondents may behave differently when obtaining the product requires them to use their own money instead of receiving a product as a reward at the end of the experiment. In such a case, respondents will pay more attention to certain attributes relevant to them in real life, but not to such an extent during the conjoint exercise, where there is a probability of obtaining the tested product. Hence, <sup>33</sup> proposed the “conjoin poker”, which is an incentive-compatible conjoint study that collects preference data in a game setting in an attempt to increase respondents’ involvement and attention. The study design resulted in increased respondent engagement and motivation, which was measured by the time they spend in the survey and by a follow-up questionnaire. Generally, the study design was found engaging and entertaining, but also complex and time-consuming.</p>
<p>The issue that still stands in order to comply with the saliency principle is how to evaluate respondents’ performance in an absence of objective truth. In 2004 Drazen Prelec proposed a solution which he called Bayesian truth serum. This paper’s main objective will be to test if the BTS can help motivate respondents to truthfully reveal their preferences and improve the quality of the data. The method works in hypothetical settings i.e.&nbsp;in a new product development context. It doesn’t alter the experimental design to an extent such as the conjoint poker. It is relatively easy for understanding by researchers and respondents. The following section described BTS intuition, assumptions, and applications.</p>
</section>
<section id="revealing-truthful-preference-with-bts" class="level3">
<h3 class="anchored" data-anchor-id="revealing-truthful-preference-with-bts">Revealing truthful preference with BTS</h3>
<p>In his work on truth-telling incentives, <sup>34</sup> recognizes another source of bias that can result in low-quality data. He suggests that in the absence of “external criteria” people can become subjects of “self-deception and false confidence even among the well-intentioned”. In order to express the notion that some experts are never subject to reality checks, Prelec compares the subjective judgment of business investors with an art critic. Both experts are making subjective judgments but the end result of the investor can be used for evaluation of his judgments (i.e.&nbsp;reality check) while for the art critic there are no external criteria for proper assessment.</p>
</section>
<section id="references" class="level3">
<h3 class="anchored" data-anchor-id="references">References</h3>
<p><em>The post has been originally published as part of my master thesis <a href="https://thesis.eur.nl/pub/39589/">Bayesian Truth Serum Fused Conjoint</a> on 29 August 2017</em></p>
<p>Literature Reference List</p>


</section>


<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>2012 Dimensions of online survey data quality. What really matters?↩︎</p></li>
<li id="fn2"><p>2012 Rules of Engagement The war against poorly engaged respondents guidelines for elimination↩︎</p></li>
<li id="fn3"><p>2012 Measuring consumer preferences using conjoint poker↩︎</p></li>
<li id="fn4"><p>2005 Incentive-aligned conjoint analysis↩︎</p></li>
<li id="fn5"><p>2005 Incentive-aligned conjoint analysis↩︎</p></li>
<li id="fn6"><p>2014 tHigher Order Risk Attitudes↩︎</p></li>
<li id="fn7"><p>2007 Incentive and informational properties of preference questions↩︎</p></li>
<li id="fn8"><p>1992 Earnings uncertainty and precautionary saving↩︎</p></li>
<li id="fn9"><p>2010 Flu shots, mammogram, and the perception of probabilities↩︎</p></li>
<li id="fn10"><p>1999 Investment and demand uncertainty↩︎</p></li>
<li id="fn11"><p>2009 Subjective probabilities in household surveys↩︎</p></li>
<li id="fn12"><p>2005 Incentive-aligned conjoint analysis↩︎</p></li>
<li id="fn13"><p>2007 An incentive-aligned mechanism for conjoint analysis↩︎</p></li>
<li id="fn14"><p>2012 Measuring consumer preferences using conjoint poker↩︎</p></li>
<li id="fn15"><p>2012 Rules of Engagement The war against poorly engaged respondents guidelines for elimination↩︎</p></li>
<li id="fn16"><p>2012 Dimensions of online survey data quality. What really matters?↩︎</p></li>
<li id="fn17"><p>2008 Beyond conjoint analysis: Advances in preference measurement↩︎</p></li>
<li id="fn18"><p>2008 Beyond conjoint analysis: Advances in preference measurement↩︎</p></li>
<li id="fn19"><p>2012 Measuring consumer preferences using conjoint poker↩︎</p></li>
<li id="fn20"><p>2005 Incentive-aligned conjoint analysis↩︎</p></li>
<li id="fn21"><p>2008 Beyond conjoint analysis: Advances in preference measurement↩︎</p></li>
<li id="fn22"><p>2005 Dynamic models incorporating individual heterogeneity: Utility evolution in conjoint analysis↩︎</p></li>
<li id="fn23"><p>2012 Measuring consumer preferences using conjoint poker↩︎</p></li>
<li id="fn24"><p>1982 Evolution and the Theory of Games↩︎</p></li>
<li id="fn25"><p>1976 The logic of asymmetric contests↩︎</p></li>
<li id="fn26"><p>2012 Measuring consumer preferences using conjoint poker↩︎</p></li>
<li id="fn27"><p>2005 Incentive-aligned conjoint analysis↩︎</p></li>
<li id="fn28"><p>2005 Incentive-aligned conjoint analysis↩︎</p></li>
<li id="fn29"><p>2007 An incentive-aligned mechanism for conjoint analysis↩︎</p></li>
<li id="fn30"><p>1964 Measuring utility by a single response sequential method↩︎</p></li>
<li id="fn31"><p>2008 Eliciting preference for complex products A web-based upgrading method↩︎</p></li>
<li id="fn32"><p>2012 Measuring consumer preferences using conjoint poker↩︎</p></li>
<li id="fn33"><p>2012 Measuring consumer preferences using conjoint poker↩︎</p></li>
<li id="fn34"><p>2004 A Bayesian truth serum for subjective data↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>market research</category>
  <category>behavioral data</category>
  <guid>https://gregordimi.com/posts/conjoint-analysis-survey-limitations/</guid>
  <pubDate>Tue, 29 Aug 2017 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Bayesian truth serum</title>
  <dc:creator>Grigor Dimitrov</dc:creator>
  <link>https://gregordimi.com/posts/bayesian-truth-serum/</link>
  <description><![CDATA[ 






<section id="intro" class="level3">
<h3 class="anchored" data-anchor-id="intro">Intro</h3>
<p>Bayesian truth serum is a methodology for eliciting subjective judgments and “unverifiable truths”, developed by an MIT professor <sup>1</sup>. Prelec recognizes the necessity of assessing subjective beliefs in absence of objective truth as opinions, attitudes, and intentions are often used in science and policymaking.</p>
<p>For example, in marketing research, companies have been using respondents’ subjective beliefs in order to create policies about products, prices, packages, features, etc. Prelec recognizes that the quality of the subjective data is limited by “its quality of the source” and argues that if respondents act as if they are being evaluated by an “onmicenter scorer in possession of the truth” the data quality will be enhanced. The mechanisms of BTS methodology grants maximum incentives for truth-telling based on Bayesian reasoning. Scoring system</p>
<p>BTS is a scoring system that assigns different scores to opinions based on their truthfulness where high scores imply high incentives. BTS consists of two components: information score and prediction score.</p>
</section>
<section id="information-score-intuition" class="level3">
<h3 class="anchored" data-anchor-id="information-score-intuition">Information score intuition</h3>
<p>Information score is estimated on question level and assigns high values to common answers and low values to the opposite. Surprisingly common answers are considered those whose actual frequency is higher than collectively predicted by the same population of interest <sup>2</sup>. Once considered an irrational bias, afterward proven as a purely rational effect, the idea behind common/uncommon answers is that opinion holders would overestimate the frequency of their own opinion amongst the population. <sup>3</sup> describe this effect as one “tend to perceive a”false consensus”-to see their own behavioral choices and judgments as relatively common and appropriate to existing circumstances while viewing alternative responses as uncommon, deviant, or inappropriate.” More precisely, it is a systematic deviation of assigning higher estimations or probabilities with regards to population frequency in directions of one’s own opinion in a group of which the subject is a member.</p>
<p>In his paper, <sup>4</sup> referred to the “false consensus bias” as “an egocentric bias to overestimate the degree in which others are like us”. <sup>5</sup> executed four studies in which they tested the “false consensus bias” in various settings such as behavioral choices, situations, and judgments as well as personal problems, expectations preferences, and characteristics. For example, a study among Stanford undergraduates <sup>6</sup> showed that students who think about dying expected that 44% of students, in general, would share their problem against students who don’t think about dying expected only 25.6% of the students to think about dying. Within the same experiment subjects who believed to die before turning age of 70 indicated that 57.6% of the students share their expectations while this number was only 43.9% for students with the opposite expectation.</p>
<p>This pattern was considered to be an irrational systematic deviation before <sup>7</sup> has proven it to be a rational effect. Using Bayesian reasoning Dawes argues that subjects are considering their own opinion to be an “informative sample of one” which shifts the estimation of endorsers of a certain opinion in a direction toward their own opinion.</p>
<p>Using Dawes’ interpretation <sup>8</sup> constructed a critical assumption; the information score component of BTS which indicates that ones’ opinion frequency will be underestimated by the others and vice versa, one will overestimate the frequency of his own opinion. Consequently, this implies that surprisingly common answers are those whose actual frequency overweighs the collectively predicted frequency. For example, let’s consider we have data about respondents being asked to state their preferences at binary choice (e.g.&nbsp;Yes/No) question. The respondents are asked to provide their own opinion as well as their estimates about the fraction of people endorsing their answer. If the actual frequency is 10% per “Yes” and the predicted frequency is 5%, the respondents who indicated “Yes” will receive a positive score as their answer will be considered “surprisingly common”. However, given the same actual frequency, if the collectively predicted frequency is 25% respondents will be penalized with a negative score as their answers will be considered uncommon.</p>
</section>
<section id="information-score-formula" class="level3">
<h3 class="anchored" data-anchor-id="information-score-formula">Information score formula</h3>
<p><sup>9</sup> defines the following formula for estimation of information score component for answer <img src="https://latex.codecogs.com/png.latex?k">:</p>
<p><img src="https://latex.codecogs.com/png.latex?%20%5Ctext%7Binformation%20score%7D%20=%20log(%5Cfrac%7B%5Coverline%7Bx%7D_%7Bk%7D%7D%7B%5Coverline%7By%7D_%7Bk%7D%7D)%20"></p>
<p>Each respondent <img src="https://latex.codecogs.com/png.latex?r"> information score per <img src="https://latex.codecogs.com/png.latex?k"> number of answers:</p>
<p><img src="https://latex.codecogs.com/png.latex?%20%5Ctext%7Binformation%20score%7D%20=%20%5Csum_%7Bk%7Dx_%7Bk%7D%5E%7Br%7Dlog(%5Cfrac%7B%5Coverline%7Bx%7D_%7Bk%7D%7D%7B%5Coverline%7By%7D_%7Bk%7D%7D)%20"></p>
<p>Where:</p>
<ul>
<li><img src="https://latex.codecogs.com/png.latex?%5Coverline%7Bx%7D_%7Bk%7D"> is the actual frequency of answer <img src="https://latex.codecogs.com/png.latex?k"> or <img src="https://latex.codecogs.com/png.latex?%5Coverline%7Bx%7D_%7Bk%7D%20=%20%5Cfrac%7B1%7D%7Bn%7D%5Csum_%7Br=1%7D%5E%7Bn%7Dx_%7Bk%7D%5E%7Br%7D"></li>
<li><img src="https://latex.codecogs.com/png.latex?%5Coverline%7By%7D_%7Bk%7D"> is the geometric average of predicted frequencies for answer <img src="https://latex.codecogs.com/png.latex?k"> or <img src="https://latex.codecogs.com/png.latex?%5Coverline%7By%7D_%7Bk%7D%20=%20%5Cleft%20(%20%5Cprod_%7Bi=1%7D%5E%7Bn%7Dy_%7Bk%7D%5E%7Br%7D%20%5Cright%20)%5E%7B%5Cfrac%7B1%7D%7Bn%7D%7D"></li>
</ul>
</section>
<section id="prediction-score-intuition" class="level3">
<h3 class="anchored" data-anchor-id="prediction-score-intuition">Prediction score intuition</h3>
<p>The second component of BTS scoring is the prediction score, which is “a penalty proportional to the relative entropy (Kullback-Leibler divergence) between the empirical distribution and respondent’s prediction of that distribution” <sup>10</sup>. In other words, this score assigns zero value to accurate prediction (i.e.&nbsp;best prediction score) when one’s prediction matches the actual frequency and penalizes for inaccurate one. It is an asymmetric estimate of the difference between two probability distributions which produces a number smaller than zero.</p>
</section>
<section id="prediction-score-formula" class="level3">
<h3 class="anchored" data-anchor-id="prediction-score-formula">Prediction score formula</h3>
<p><img src="https://latex.codecogs.com/png.latex?%20%5Ctext%7Bprediction%20score%7D%20=%20%5Calpha%20%5Ccdot%20%5Csum%5Climits_%7Bk%7D%5E%7B%7D%20%5Coverline%7Bx%7D_%7Bk%7D%20%5Ccdot%20log%20%5Cfrac%7By%5E%7Br%7D_k%20%7D%7B%5Coverline%7Bx%7D_%7Bk%7D%20%7D%20"></p>
<p><img src="https://latex.codecogs.com/png.latex?%5Calpha"> is a constant used for assigning different weights to the prediction score relative to the information score in the BTS final score. Setting <img src="https://latex.codecogs.com/png.latex?%5Calpha"> equal to 1 will assign equal weights to the score of the equation which will result in a zero-sum game. In the zero-sum game, the average of all BTS scores is equal to zero. When <img src="https://latex.codecogs.com/png.latex?%5Calpha"> approaches zero BTS game results in “Pareto-dominate expected scores” in which at least one individual has a positive score.</p>
</section>
<section id="bts-formula" class="level3">
<h3 class="anchored" data-anchor-id="bts-formula">BTS formula</h3>
<p>The overall score for each respondent is:</p>
<p><img src="https://latex.codecogs.com/png.latex?%20%5Ctext%7BBTS%20score%7D%20=%20%5Ctext%7BInformation%20score%7D%20+%20%5Ctext%7BPrediction%20score%7D%20"></p>
</section>
<section id="bts-assumptions" class="level3">
<h3 class="anchored" data-anchor-id="bts-assumptions">BTS Assumptions</h3>
<p><sup>11</sup> relies on several assumptions for constructing BTS algorithm:</p>
<p>Bayesian Nash equilibrium</p>
<p>“Truth-telling is individually and collectively optimal”<sup>12</sup>. Taking into account the BTS assumptions, agents stating their true preferences is BTS Nash equilibrium for any α&gt;0. Thus, it is individually optimal as BTS Nash equilibrium results in a maximum expected payoff. It is collectively optimal because there is no other equilibrium which results in a higher information score for any agent. The equilibrium relies on two assumptions:</p>
<ol type="1">
<li>There is a large enough sample so that a single answer can not affect the overall distribution;</li>
<li>All agents are Bayesians. They have a common prior and they update their beliefs based on their opinions;</li>
</ol>
</section>
<section id="bts-validity" class="level3">
<h3 class="anchored" data-anchor-id="bts-validity">BTS validity</h3>
<p>Although the BTS is a relatively easy method that can be implemented within a study design, little has been done to assess its validity. So far, the results are positive regarding the usage of the approach.</p>
<p>In an attempt to eliminate hypothetical bias in contingent valuation (CV) <sup>13</sup> compared three mechanisms to elicit subjects’ true preferences along with real and hypothetical CV in two settings. The results showed that BTS was able to eliminate the hypothetical bias in one of the settings but only reduce it in the other. The authors conclude that BTS eliminates the hypothetical bias inconsistently. Interestingly enough, the authors also found an interaction between BTS and subjects’ characteristics.</p>
<p><sup>14</sup> emphasized that accurate prediction of performance on the market when products are not yet available is crucial to the business’s success. In a study that aims to predict a medical product adoption on the market, the authors made the first empirical validation of BTS. In order to improve the predictive performance, the approach is adopted, based on the notion that “bad” respondents “hurt” the data, hence the authors exclude respondents with a low score (i.e.&nbsp;the untruthful ones). Applying BTS on data from 1763 physicians, BTS improved the overall performance up to 21% compared to a simple average from the full sample. An interesting particularity, contradictory to the original BTS article by <sup>15</sup>, is that the authors did not explain the BTS scoring concept to the participants, arguing that it is impractical and it hasn’t been empirically validated to improve the data.</p>
<p>In the study of <sup>16</sup>, the authors conducted 5 experiments testing different aspects of BTS. They tested the validity of BTS upon respondents recognizing real and fake items from different categories such as brands, movies, journals, etc. The authors tested BTS in the following settings: Recognition questionnaires, in 2x2 between-subject design which consists of truth-telling (Control vs.&nbsp;BTS) and deception incentives (incentives for recognizing items vs.&nbsp;none). For the first experiment, the authors noted that it is not clear whether the performance of BTS is because of the truth-telling incentives or because of the claim made about them. To eliminate this doubt, keeping the same experimental settings, respondents were presented with their information score after each question. BTS was also compared to another “truth serum”, the solemn oath. It requires participants to sign a declaration of their honesty, and again, respondents were given incentives to exaggerate their knowledge. BTS was also applied in the evaluation of a public good, e.g.&nbsp;it was applied on CV, in an attempt to eliminate the hypothetical bias. The experiments results showed good performance of BTS in recognizing real and fake items. The method performed well even when respondents were given incentives to overclaim item recognition. The results indicated there is strong evidence that instructing respondents about BTS has a positive impact on truth-telling. BTS results outperformed the “solemn oath” and successfully eliminated the hypothetical bias in CV. Important to notice in this research is that the authors provided empirical evidence that proper BTS instructions will result in higher data quality, a claim that was fairly questioned by <sup>17</sup>. Furthermore, the results showed that BTS eliminated the hypothetical bias in CV and the authors speculated that the mixed evidence about BTS performance in <sup>18</sup>, possibly result from a difference in the instructions. <sup>19</sup> also addresses interesting pragmatic issues that will be discussed in another part of the paper.</p>
<p>In an interesting article about Questionable Research Practices (QRPs) <sup>20</sup> used by the scientific community, the authors applied BTS to a big sample (2155) of research psychologists. The BTS condition showed a significant difference in the results compared to the control group in 4 out of 10 measures of QRPs. The authors argue that the answers obtained with BTS incentives are more truthful. Following the fashion of investigating shameful activities from the QRPs article, <sup>21</sup> apply BTS to investigate downloading intellectual property from unauthorized sources. BTS elicited around 60 percent higher self-admission rates on average compared to the control group. The authors interpreted the results as plausible in favor of BTS.</p>
<p>BTS has not been applied in the preference measurement domain yet. As there might be a discrepancy between one’s preference in real life and in a conjoint context, BTS can play a significant role when measuring respondents’ preferences when constructing new products, services, or policies. The successful introduction of an optimal combination of attributes for a new product, service, or policy will crucially depend on respondents’ truthfulness. Given the importance of accurately predicting the optimal product, service, or policy product features, truthful elicitation is key when obtaining respondents’ preferences.</p>
</section>
<section id="references" class="level3">
<h3 class="anchored" data-anchor-id="references">References</h3>
<p><em>The post has been originally published as part of my master thesis <a href="https://thesis.eur.nl/pub/39589/">Bayesian Truth Serum Fused Conjoint</a> on 29 August 2017</em>—</p>


</section>


<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>2004 A Bayesian Truth Serum For Subjective Data↩︎</p></li>
<li id="fn2"><p>2004 A Bayesian Truth Serum For Subjective Data↩︎</p></li>
<li id="fn3"><p>1977 The “false Consensus Effect”: An Egocentric Bias In Social Perception And Attribution Processes↩︎</p></li>
<li id="fn4"><p>1989 Statistical Criteria For Establishing A Truly False Consensus Effect↩︎</p></li>
<li id="fn5"><p>1977 The “false Consensus Effect”: An Egocentric Bias In Social Perception And Attribution Processes↩︎</p></li>
<li id="fn6"><p>1977 The “false Consensus Effect”: An Egocentric Bias In Social Perception And Attribution Processes↩︎</p></li>
<li id="fn7"><p>1989 Statistical Criteria For Establishing A Truly False Consensus Effect↩︎</p></li>
<li id="fn8"><p>2004 A Bayesian Truth Serum For Subjective Data↩︎</p></li>
<li id="fn9"><p>2004 A Bayesian Truth Serum For Subjective Data↩︎</p></li>
<li id="fn10"><p>2004 A Bayesian Truth Serum For Subjective Data↩︎</p></li>
<li id="fn11"><p>2004 A Bayesian Truth Serum For Subjective Data↩︎</p></li>
<li id="fn12"><p>2004 A Bayesian Truth Serum For Subjective Data↩︎</p></li>
<li id="fn13"><p>2010 A Penny For Your Thoughts: Inducing Truth-telling In Stated Preference Elicitation↩︎</p></li>
<li id="fn14"><p>2011 Predicting New Product Adoption Using Bayesian Truth Serum↩︎</p></li>
<li id="fn15"><p>2004 A Bayesian Truth Serum For Subjective Data↩︎</p></li>
<li id="fn16"><p>2013 Creating Truth-telling Incentives With The Bayesian Truth Serum↩︎</p></li>
<li id="fn17"><p>2011 Predicting New Product Adoption Using Bayesian Truth Serum↩︎</p></li>
<li id="fn18"><p>2010 A Penny For Your Thoughts: Inducing Truth-telling In Stated Preference Elicitation↩︎</p></li>
<li id="fn19"><p>2013 Creating Truth-telling Incentives With The Bayesian Truth Serum↩︎</p></li>
<li id="fn20"><p>2012 Measuring The Prevalence Of Questionable Research Practices With Incentives For Truth Telling↩︎</p></li>
<li id="fn21"><p>2015 We All Do It, But Are We Willing To Admit? Incentivizing Digital Pirates’ Confessions↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>marketing</category>
  <category>behavioral data</category>
  <guid>https://gregordimi.com/posts/bayesian-truth-serum/</guid>
  <pubDate>Sat, 26 Aug 2017 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Conjoint analysis - review</title>
  <dc:creator>Grigor Dimitrov</dc:creator>
  <link>https://gregordimi.com/posts/conjoint-analysis-review/</link>
  <description><![CDATA[ 






<p>Summary: In a nutshell, conjoint analysis is a research methodology that uses surveys to understand how people make choices. It relies heavily on subjective data (beliefs, opinions, expectations, etc.) to understand individuals’ behavior, attitude, intentions, and choices.</p>
<p>In economics, often the decision-making process relies both on ‘soft factors’ and ‘hard numbers’ <sup>1</sup>. The hard numbers are objective quantitative measurements, while the soft factors refer to beliefs, opinions, expectations, etc. that are subjective. Subjective data is heavily used to understand individuals’ behavior, attitude, intentions and choices in many different domains, including governmental institutions and businesses <sup>2</sup>.</p>
<p>One specific domain is opinion-taking for market research purposes, which again relies heavily on subjective data gathered through surveys from panels of respondents. However, subjective data reliability depends on “its quality at the source - the thought process of an individual respondent” <sup>3</sup>. To provide solid and credible recommendations to businesses, market researchers, who use surveys as a proxy of their decisions, crucially depend on respondents’ trustworthiness.</p>
<p>One of the widely used “advanced” research methodologies for the past four decades is the conjoin methodology. It has been employed in many domains such as market research, policy making, exploring optimal pricing of products, new product development, segmentation, product positioning, etc. <sup>4</sup>. It is a broad methodology for presenting and analyzing products, services or policies. Using conjoint analysis researchers are able to elicit respondents’ utilities of different characteristics of a product, service or policy. Those utilities are estimated based on data from respondents’ simultaneous evaluation of components configurations across different attributes levels of a product, service or policy, also referred to as stimuli <sup>5</sup>; <sup>6</sup>. Essentially, respondents are making trade-offs within a given set of product characteristics and state their preferences for the different stimuli. In the estimation process researchers are able to elicit respondents’ utilities based on those trade-offs on an individual level as well as aggregating the utilities in the sample.</p>
<section id="origins-of-conjoint-methodology-and-analysis" class="level3">
<h3 class="anchored" data-anchor-id="origins-of-conjoint-methodology-and-analysis">Origins of conjoint methodology and analysis</h3>
<p>Conjoint analysis has been used for circa 44 years and it is still evolving. It was introduced to academia by <sup>7</sup> in their paper “Conjoint Measurement for Quantifying Judgmental Data”. Shortly afterward, it was adopted by practitioners in diverse areas such as new product development, pricing, segmentation, and positioning <sup>8</sup>. Initially, the theory was referred to as conjoint measurement, but once it was appreciated by practitioners and transformed to evolving research stream by scientists, the term conjoint analysis (hereafter “CA”) was adopted <sup>9</sup>. Nowadays, the term CA is used both as a reference to the theory behind measuring judgmental data as well as for different methods used for this purpose <sup>10</sup>. In the next sections, I will introduce a brief description of the theory behind CA followed by the introduction to CA design. As this paper will employ choice-based conjoint (hereafter “CBC”) the CA design section will be focused on CBC.</p>
</section>
<section id="multidimensional-scaling-judgmental-data-and-choice-data" class="level3">
<h3 class="anchored" data-anchor-id="multidimensional-scaling-judgmental-data-and-choice-data">Multidimensional scaling, judgmental data, and choice data</h3>
<p>CA originates from mathematical psychology <sup>11</sup> and it faces the mapping challenge of multidimensional scaling (MDS) to “translate a point from perceptual space into a corresponding point(s) of product feature space” <sup>12</sup>. More precisely, the mapping challenge emerged from psychometrics, explored by <sup>13</sup> in their influential book “Foundations of measurement”, where the authors investigated behavioral axioms that would make possible decomposition of an overall judgment.</p>
<p><sup>14</sup> explains that essentially CA is a method for MDS and clustering applied to marketing questions. Paul Green uses MDS to decompose overall consumers’ preferences and perceptions toward a certain product into a partial contribution of the product’s features (also called “part-worths”). Quoting <sup>15</sup> seems the most appropriate to explain the name of this elegant theory “ … applications by psychometricians and consumer researchers have emphasized the scaling aspects - finding specific numerical scale values, assuming that a particular composition rule applies, possibly with some error. Accordingly, it now seems useful to adopt the name, conjoint analysis, to cover models and techniques that emphasize the transformation of subjective responses into estimated parameters”. <sup>16</sup> defines judgmental data measurement as respondents’ evaluation of a product profiles represented by a set of alternatives of products’ attributes. The data is usually in at least an ordinal scale resulting from rating or ranking the profiles. In the same paper, the author defines choice data as a respondent’s preference of a particular profile among a given set of profiles. Profiles are again represented by a composition of product attributes. According to <sup>17</sup>, the terms judgmental and choice data have been used as mutually replaceable. However, there is an important distinction between judgmental and choice data, namely, judgment data may not satisfy important assumptions that are needed to forecast choice behavior.</p>
<p>Choice-based conjoint was proposed by <sup>18</sup> as an extension of the traditional conjoint analysis. The authors introduced CBC following the recent development in the choice behavior modeling, namely, the introduction of multinomial and conditional logit models by <sup>19</sup>. CBC constitutes a choice evaluation between profiles. It allows for interaction and cross effects between different attributes <sup>20</sup>. Moreover, with CBC it is possible to measure preferences at an individual level and it represents a realistic choice task in which respondents are required to make a certain trade-off.</p>
</section>
<section id="references" class="level2">
<h2 class="anchored" data-anchor-id="references">References</h2>
<p><em>The post has been originally published as part of my master thesis <a href="https://thesis.eur.nl/pub/39589/">Bayesian Truth Serum Fused Conjoint</a> on 29 August 2017</em></p>
<p>Literature Reference List</p>


</section>


<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>2013 Subjective probability and Bayesian truth serum↩︎</p></li>
<li id="fn2"><p>2004 A Bayesian truth serum for subjective data↩︎</p></li>
<li id="fn3"><p>2004 A Bayesian truth serum for subjective data↩︎</p></li>
<li id="fn4"><p>2005 Incentive-aligned conjoint analysis↩︎</p></li>
<li id="fn5"><p>2001 Thirty years of conjoint analysis: Reflections and prospects↩︎</p></li>
<li id="fn6"><p>1978 Conjoint analysis in consumer research: issues and outlook↩︎</p></li>
<li id="fn7"><p>1971 Conjoint measurement for quantifying judgmental data↩︎</p></li>
<li id="fn8"><p>2005 Incentive-aligned conjoint analysis↩︎</p></li>
<li id="fn9"><p>2004 Conjoint analysis, related modeling, and applications↩︎</p></li>
<li id="fn10"><p>1988 Conjoint analysis modelling of stated preferences: a review of theory, methods, recent developments and external validity↩︎</p></li>
<li id="fn11"><p>1978 Conjoint analysis in consumer research: issues and outlook↩︎</p></li>
<li id="fn12"><p>2004 Conjoint analysis, related modeling, and applications↩︎</p></li>
<li id="fn13"><p>1971 Foundations of measurement↩︎</p></li>
<li id="fn14"><p>2004 Conjoint analysis, related modeling, and applications↩︎</p></li>
<li id="fn15"><p>1978 Conjoint analysis in consumer research: issues and outlook↩︎</p></li>
<li id="fn16"><p>1988 Conjoint analysis modelling of stated preferences: a review of theory, methods, recent developments and external validity↩︎</p></li>
<li id="fn17"><p>1988 Conjoint analysis modelling of stated preferences: a review of theory, methods, recent developments and external validity↩︎</p></li>
<li id="fn18"><p>1983 Design and analysis of simulated consumer choice or allocation experiments: an approach based on aggregate data↩︎</p></li>
<li id="fn19"><p>Conditional Logit Analysis of Qualitative Choice Behavior↩︎</p></li>
<li id="fn20"><p>2000 An overview and comparison of design strategies for choice-based conjoint analysis↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>market research</category>
  <category>behavioral data</category>
  <guid>https://gregordimi.com/posts/conjoint-analysis-review/</guid>
  <pubDate>Sat, 26 Aug 2017 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Conjoint analysis - design</title>
  <link>https://gregordimi.com/posts/conjoint-analysis-design/</link>
  <description><![CDATA[ 






<p>Summary: In a nutshell, conjoint analysis is a research methodology that uses surveys to understand how people make choices. It relies heavily on subjective data (beliefs, opinions, expectations, etc.) to understand individuals’ behavior, attitude, intentions, and choices. Check the intro <a href="https://gregordimi.com/conjoint/2017/08/26/Erasmus-Conjoint-Design.html">here</a></p>
<section id="designing-a-choice-based-conjoint" class="level3">
<h3 class="anchored" data-anchor-id="designing-a-choice-based-conjoint">Designing a choice-based conjoint</h3>
<p>There are several critical steps involved in designing conjoint experiments that are common for all CA <sup>1</sup>; <sup>2</sup>;.</p>
<ol type="1">
<li>Decomposition of product on product attributes</li>
<li>Stimuli representation</li>
<li>Stimuli configuration</li>
<li>Data collection</li>
<li>Estimation</li>
</ol>
<p>Due to the broadness of the term CA, it is difficult to assign a meaningful explanation of each step without focusing on a particular CA approach. Although the first 2 steps are common for all types of CA, stimuli configuration, data collection, and estimation tasks are interlinked. <span class="citation" data-cites="louviere1988conjoint">@louviere1988conjoint</span> refers to the first three common steps as experimental design techniques and explains that researchers rely on them to create profile configuration. However, the data collection and estimation vary per different “paradigms” (or approaches used above). For example, collection and employing judgmental data implies evaluation of one profile at a time by rating it on an ordinal scale, which is referred to as “Rating-based conjoint”, while choice data implies a choice of one profile among several at a time mimicking real purchase behavior which is referred to as “Choice-based conjoint”. Depending on the different data collection techniques, the method of analysis and estimation of the “part-worth” utilities differs. The focus of data collection and estimation will be on CBC while briefly describing the other possible approaches.</p>
<section id="decomposition-of-product-on-product-attributes" class="level4">
<h4 class="anchored" data-anchor-id="decomposition-of-product-on-product-attributes">Decomposition of product on product attributes</h4>
<p>2 critical issues should be taken into account in this first step. First, defining product’s attributes and respectively the levels in which each attribute is divided. Second, defining the function of each attribute, respectively each attribute level, in the overall model of respondents’ preferences. Functions can be vector monotone preference (approximately linear), ideal point preference (convex or concave), and part-worth preference (discrete or categorical). In contemporary literature on the topic, all preference functions are referred to as “part-worths”, although they may have different functions in the overall preference structure according to earlier articles.</p>
<p>To illustrate the steps better, I will use an example. Company X is planning to release a new smartphone on the market. After preliminary research, company X decides that the most important features of their smartphone are: Product name, Screen size, Memory, and Price. After consultation with engineering and marketing departments, the following product attribute levels can be distinguished:</p>
<p>Table 1</p>
<p>If we consider independently price and memory, they would have approximately linear utility for the respondents (i.e.&nbsp;the higher the price, the lower utility). However, considering the screen size, we can expect a concave shape of the preference (i.e.&nbsp;most people would probably prefer neither too small nor too big a phone). As the brand name is a discrete preference, it belongs to the so-called part worth preferences.</p>
</section>
<section id="stimuli-representation" class="level4">
<h4 class="anchored" data-anchor-id="stimuli-representation">Stimuli representation</h4>
<p>There are many ways that stimuli can be presented to subjects such as text, pictures, video, physical objects, and even verbal description. However, as in recent years, the established way of conducting marketing research interviews is in online web-based forms, researchers are taking advantage of various kinds of available multimedia <sup>3</sup>. Naturally, the more realistic the stimuli are presented to the subjects the better quality of the data is to be expected.</p>
</section>
<section id="stimuli-configuration" class="level4">
<h4 class="anchored" data-anchor-id="stimuli-configuration">Stimuli configuration</h4>
<p>Once the product is decomposed on its attributes and attributes’ levels, a large number of product profiles can be generated per each combination. However, ever since the emergence of CA, researchers recognized that showing all possible products profiles is not feasible as it is tiresome for the respondents and therefore, it is not cost-effective and can potentially lead to biased estimates <sup>4</sup>.</p>
<p>To limit respondents’ burden and provide more robust estimates, several approaches to reduce product profiles can be applied. However, product profile configuration is closely related to the data collection method and estimations, thus, collection and estimation cannot be examined independently. For example, one way to reduce product profiles is orthogonal fractional factorial design or just “orthogonal design”. In an orthogonal design, only the extreme combinations of products’ features are being evaluated, “the levels of the features are chosen such that, for each pair of features, say a and b, the high level a appear equally often in profiles that have a high-level b as in profiles that have a low level of b, and vice versa” <sup>5</sup>. In a demonstration paper, <span class="citation" data-cites="green1974design">@green1974design</span> applied orthogonal design to an extreme example of 4x3x27 (1536) product profiles, was able to reduce the product profiles to only 16 to estimate the main effects. As expected, such reduction comes with certain trade-offs, that is, preference independence assumption, which does not allow any interactions among the different attributes to be estimated.</p>
<p>Table 2 Orthogonal design example</p>
<table class="caption-top table">
<thead>
<tr class="header">
<th style="text-align: center;">Card ID</th>
<th style="text-align: left;">Brand Name</th>
<th style="text-align: center;">Screen Size</th>
<th style="text-align: center;">Memory</th>
<th style="text-align: center;">Price</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: center;">1</td>
<td style="text-align: left;">ProductA</td>
<td style="text-align: center;">4’</td>
<td style="text-align: center;">32</td>
<td style="text-align: center;">300</td>
</tr>
<tr class="even">
<td style="text-align: center;">2</td>
<td style="text-align: left;">ProductB</td>
<td style="text-align: center;">3’</td>
<td style="text-align: center;">32</td>
<td style="text-align: center;">400</td>
</tr>
<tr class="odd">
<td style="text-align: center;">3</td>
<td style="text-align: left;">ProductB</td>
<td style="text-align: center;">5’</td>
<td style="text-align: center;">32</td>
<td style="text-align: center;">200</td>
</tr>
<tr class="even">
<td style="text-align: center;">4</td>
<td style="text-align: left;">ProductB</td>
<td style="text-align: center;">6’</td>
<td style="text-align: center;">64</td>
<td style="text-align: center;">300</td>
</tr>
<tr class="odd">
<td style="text-align: center;">5</td>
<td style="text-align: left;">ProductA</td>
<td style="text-align: center;">5’</td>
<td style="text-align: center;">16</td>
<td style="text-align: center;">300</td>
</tr>
<tr class="even">
<td style="text-align: center;">6</td>
<td style="text-align: left;">ProductB</td>
<td style="text-align: center;">5’</td>
<td style="text-align: center;">16</td>
<td style="text-align: center;">200</td>
</tr>
<tr class="odd">
<td style="text-align: center;">7</td>
<td style="text-align: left;">ProductB</td>
<td style="text-align: center;">6’</td>
<td style="text-align: center;">16</td>
<td style="text-align: center;">400</td>
</tr>
<tr class="even">
<td style="text-align: center;">8</td>
<td style="text-align: left;">ProductA</td>
<td style="text-align: center;">5’</td>
<td style="text-align: center;">64</td>
<td style="text-align: center;">400</td>
</tr>
<tr class="odd">
<td style="text-align: center;">9</td>
<td style="text-align: left;">ProductA</td>
<td style="text-align: center;">3’</td>
<td style="text-align: center;">16</td>
<td style="text-align: center;">200</td>
</tr>
<tr class="even">
<td style="text-align: center;">10</td>
<td style="text-align: left;">ProductA</td>
<td style="text-align: center;">6’</td>
<td style="text-align: center;">32</td>
<td style="text-align: center;">200</td>
</tr>
<tr class="odd">
<td style="text-align: center;">11</td>
<td style="text-align: left;">ProductB</td>
<td style="text-align: center;">3’</td>
<td style="text-align: center;">16</td>
<td style="text-align: center;">300</td>
</tr>
<tr class="even">
<td style="text-align: center;">12</td>
<td style="text-align: left;">ProductA</td>
<td style="text-align: center;">6’</td>
<td style="text-align: center;">16</td>
<td style="text-align: center;">200</td>
</tr>
<tr class="odd">
<td style="text-align: center;">13</td>
<td style="text-align: left;">ProductA</td>
<td style="text-align: center;">3’</td>
<td style="text-align: center;">64</td>
<td style="text-align: center;">200</td>
</tr>
<tr class="even">
<td style="text-align: center;">14</td>
<td style="text-align: left;">ProductB</td>
<td style="text-align: center;">4’</td>
<td style="text-align: center;">64</td>
<td style="text-align: center;">200</td>
</tr>
<tr class="odd">
<td style="text-align: center;">15</td>
<td style="text-align: left;">ProductB</td>
<td style="text-align: center;">4’</td>
<td style="text-align: center;">16</td>
<td style="text-align: center;">200</td>
</tr>
<tr class="even">
<td style="text-align: center;">16</td>
<td style="text-align: left;">ProductA</td>
<td style="text-align: center;">4’</td>
<td style="text-align: center;">16</td>
<td style="text-align: center;">400</td>
</tr>
</tbody>
</table>
<p>For instance, our smartphone example would generate a total of 72 (2x4x3x3) possible product profiles. As seen in Table 2, using the orthogonal design we can reduce this number to 16. Orthogonal design, full factorial design, and fractional factorial design are the starting point for more advanced stimuli configurations that are used in practice nowadays.</p>
</section>
<section id="data-collection" class="level4">
<h4 class="anchored" data-anchor-id="data-collection">Data collection</h4>
<p>The methods described below are proven to be reliable in large-scale commercial applications (see for discussion).</p>
<ul>
<li>Partial profile CA</li>
</ul>
<p>Also known as Two-attribute-at-a-time trade-off analysis, in this setting, respondents are presented to two attribute trade-off tables where they rank their preferences for different attribute levels. The number of stimuli can vary from two to many, nonetheless, two attributes at a time are the most popular.</p>
<ul>
<li>Full-Profile CA</li>
</ul>
<p>Products are described by the levels of the attributes they contain. Respondents are then asked to rank order all stimuli or to provide a metric rating of each stimulus. By controlling the attribute combinations, based on correlations of the attributes with respondents’ preferences, the utility for each level of each attribute tested can be estimated.</p>
<ul>
<li>Choice-Based (CBC)/Discrete-Choice CA</li>
</ul>
<p>Respondents are presented with a given set of product profiles, once they make their choice a new set is presented. The utilities are estimated based on respondents’ choices. Also known as stated preference models, they are based on random utility models (RUM). Respondent’s utility is presented as a combination of the product’s features and an error term. Based on the assumption about the distribution of the error term, the probability of purchase of a product assembled out of a given set of features can be estimated.</p>
<ul>
<li>Adaptive CA</li>
</ul>
<p>Currently, the most preferred way of data collection is computer-based interviews, this enables the researcher to make computations during the interview itself and adapt consecutive questions based on utilities estimated during the initial stage of the exercise. This method allows for reducing the survey length without losing valuable information or diminishing the power of the analysis.</p>
</section>
<section id="estimation" class="level4">
<h4 class="anchored" data-anchor-id="estimation">Estimation</h4>
<ul>
<li>Regression-based models</li>
</ul>
<p>If the data obtained from the respondents for their preferences is an interval scale, then the part worths can be represented by dummy variables and ordinary least square (OLS) estimation can be adopted.</p>
<ul>
<li>Random utility models (RUM)</li>
</ul>
<p>If the data obtained is from CBC, RUM can be adopted. The assumption of utility maximization combined with distributional assumptions of the unobserved term states that there is “a known function that maps the part-worth levels onto the probabilities that each profile is chosen from a given choice set” <sup>6</sup>.</p>
<ul>
<li>Hierarchical Bayes Estimation (HB)</li>
</ul>
<p>To improve the predictive power of CA, researchers approached the problem using HB estimation. However, using HB slightly changes the idea of the analysis i.e.&nbsp;researchers do not try to estimate the patchworks, but rather attempt to characterize the uncertainty behind them e.g.&nbsp;the HB estimation allows for more accurate results while showing respondents fewer choice tasks.</p>
<p>Conjoint analysis has been widely used in many different domains in market research, allowing businesses to optimize their product development, pricing strategy, find the optimal product or portfolio configuration, etc. However, in a marker research workplace, typically the conjoint exercise is administered in a hypothetical environment. In such an environment, respondents could potentially give ‘hypothetical answers’ <sup>7</sup> as respondents are not offered a strong incentive to carefully and thoughtfully think about their answers <sup>8</sup>. Recently, researchers have examined different incentive-compatible methods that could measure better respondents’ true preferences in the conjoint analysis <sup>9</sup>; <sup>10</sup>; <sup>11</sup>. In the next section, I will focus on specific problems of online opinion taking and how incentive-compatible methodologies can improve model performance while at the same time increasing respondents’ engagement and motivation.</p>
</section>
</section>
<section id="references" class="level2">
<h2 class="anchored" data-anchor-id="references">References</h2>
<p><em>The post has been originally published as part of my master thesis <a href="https://thesis.eur.nl/pub/39589/">Bayesian Truth Serum Fused Conjoint</a> on 29 August 2017</em></p>
<p>Literature Reference List</p>


</section>


<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>1978 Conjoint analysis in consumer research: issues and outlook↩︎</p></li>
<li id="fn2"><p>1990 Conjoint analysis in marketing: new developments with implications for research and practice↩︎</p></li>
<li id="fn3"><p>2000 The predictive power of internet-based product concept testing using visual depiction and animation↩︎</p></li>
<li id="fn4"><p>1978 Robustness of conjoint analysis: Some Monte Carlo results↩︎</p></li>
<li id="fn5"><p>2007 A note on conjoint analysis↩︎</p></li>
<li id="fn6"><p>2004 Conjoint analysis, related modeling, and applications↩︎</p></li>
<li id="fn7"><p>1965 The valuation of game resources: some theoretical aspects↩︎</p></li>
<li id="fn8"><p>2005 Incentive-aligned conjoint analysis↩︎</p></li>
<li id="fn9"><p>2005 Incentive-aligned conjoint analysis↩︎</p></li>
<li id="fn10"><p>2007 An incentive-aligned mechanism for conjoint analysis↩︎</p></li>
<li id="fn11"><p>2012 Measuring consumer preferences using conjoint poker↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>market research</category>
  <guid>https://gregordimi.com/posts/conjoint-analysis-design/</guid>
  <pubDate>Sat, 26 Aug 2017 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Behavioral data part - mothers study</title>
  <link>https://gregordimi.com/posts/bahavioral-data-mothers-study/</link>
  <description><![CDATA[ 






<p>Millennials matter. There is no question about the importance of millennials as a target group for brands. Their (online) purchasing power is significant. However, this generation has also witnessed financial uncertainty which makes them more fiscally conservative – they want to play it safe. This makes it even more important to understand their decision making process to successfully turn them into customers.</p>
<p>Millennials have grown up. ‘First comes marriage, then offspring’ – This is one of the conventions that millennials have turned around. They place more importance on being parents, but not necessarily getting married. A birth of a child is a turning point in everyone’s life. New priorities are being set and new brand loyalties are being built.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://gregordimi.com/posts/bahavioral-data-mothers-study/FemaleMillennials.png" class="img-fluid figure-img"></p>
<figcaption>MillennialWomen</figcaption>
</figure>
</div>
<section id="research-objective" class="level2">
<h2 class="anchored" data-anchor-id="research-objective">Research objective</h2>
<p>Millennials starting their own families made us curious about the details of how they behave online. 3 out of 4 moms identify themselves as the primary shopper in their household.1 62% of them use shopping apps. 50% actively use social media, in comparison to 37% of the rest of the population.2</p>
<p>This is why we chose the following groups, using sample from Netquest in Brazil:</p>
<ul>
<li>No kids/not pregnant</li>
<li>Pregnant</li>
<li>Kids (0 to 12 months)</li>
<li>Kids (12 to 48 months)</li>
</ul>
<p>This research aims to understand the online behavior of pregnant millennials, millennial moms with kids of different ages and millennials without children to uncover differences in the behavior at different family statuses.</p>
</section>
<section id="research-questions" class="level2">
<h2 class="anchored" data-anchor-id="research-questions">Research questions</h2>
<ul>
<li>When are the different groups active online?</li>
<li>How active are the different groups online?</li>
<li>How is their activity split across different devices?</li>
<li>What do they do online across different categories?</li>
</ul>
</section>
<section id="methodology" class="level2">
<h2 class="anchored" data-anchor-id="methodology">Methodology</h2>
<p>As a first step of this exploratory analysis, we targeted the different sample groups with a survey of their family status.</p>
<p>The passive behavioral data of these different sample groups across one month of desktop and mobile usage was classified into various categories of interest.</p>
</section>
<section id="sample" class="level2">
<h2 class="anchored" data-anchor-id="sample">Sample</h2>
<p>On desktop, the sample groups have been distributed as follows:</p>
<section id="desktop" class="level3">
<h3 class="anchored" data-anchor-id="desktop">Desktop</h3>
<p><img src="https://gregordimi.com/posts/bahavioral-data-mothers-study/GraphSampleDesktop.png" class="img-fluid"></p>
<p>On mobile, the sample groups have been distributed as follows:</p>
</section>
<section id="mobile" class="level3">
<h3 class="anchored" data-anchor-id="mobile">Mobile</h3>
<p><img src="https://gregordimi.com/posts/bahavioral-data-mothers-study/GraphSampleMobile.png" class="img-fluid"></p>
</section>
</section>
<section id="results" class="level2">
<h2 class="anchored" data-anchor-id="results">Results</h2>
<p>Let’s start with some big numbers:<br>
<img src="https://gregordimi.com/posts/bahavioral-data-mothers-study/numbers.png" class="img-fluid"></p>
<p>We looked at the overall daily and weekly desktop and mobile activity for each group:</p>
<section id="desktop-activity" class="level3">
<h3 class="anchored" data-anchor-id="desktop-activity">Desktop activity</h3>
<p><img src="https://gregordimi.com/posts/bahavioral-data-mothers-study/GraphDesktopDay.png" class="img-fluid"></p>
<p><img src="https://gregordimi.com/posts/bahavioral-data-mothers-study/GraphDesktopWeek.png" class="img-fluid"></p>
<p>Across all groups we can see similar behavior regarding the activity levels at different times of the day. Within each group the activity in the evening is the highest. Pregnant women have the highest activity across all groups during the evening.</p>
<p>Overall, the activity of women with small kids is the lowest, which supports our hypothesis that they don’t have as much time alone to spend on their desktop device and instead spend most of their time with their kids. Compared to that, pregnant women are significantly more active.</p>
<p>The level of activity for women with older kids (12m-48m) and women without kids is very similar. This leads us to the conclusion that as the kids get older, the desktop activity of these moms shifts towards their behavior before being pregnant and having a baby, because they start to have more time without their kids.</p>
<p>All groups are more active in the beginning of the week (Monday - Wednesday) compared to the rest of the week. Tuesday and Wednesday are the most active days and Saturday the day with the lowest activity. This could mean that the family spends more time together or outside of the home during the weekend.</p>
</section>
<section id="mobile-activity" class="level3">
<h3 class="anchored" data-anchor-id="mobile-activity">Mobile activity</h3>
<p><img src="https://gregordimi.com/posts/bahavioral-data-mothers-study/GraphMobileDay.png" class="img-fluid"></p>
<p><img src="https://gregordimi.com/posts/bahavioral-data-mothers-study/GraphMobileWeek.png" class="img-fluid"></p>
<p>The behavior of women with small kids (0m-12m) is the most irregular regarding the times of the day. Apart from these peaks, the spread of activity within each group is similar when looking at the different times of the day.</p>
<p>Women with kids from 12-48 months have the highest activity across all groups during the evening. Overall, the differences in the behavior are not as big as on desktop devices, which might have to do with the integration of mobile devices into our lives, and the fact that mobile devices are used more on the side.</p>
<p>Women without kids have the lowest activity across the groups, which might have to do with the fact that they spend more time with offline activities and are working during the day. However, their highest activity is from Monday to Wednesday with a huge decrease in activity from Thursday to Saturday.</p>
<p>The mobile activity of women without kids as well as of women with small kids (0m-12m) increases a lot from Saturday (lowest activity) to Sunday. Women with small kids (0m-12m) even have their highest activity on Sunday. The reason for that might be that moms get some support with the kids.</p>
<p>The activity spread of women with kids between 12-48 months is most variable from day to day – their highest activity is on Wednesday, the lowest on Thursday. Also, the activity increases on Saturday, while it drops on Sunday.</p>
</section>
<section id="categories" class="level3">
<h3 class="anchored" data-anchor-id="categories">Categories</h3>
<p>We categorized the data into 12 different categories to explore the frequency of visits and the differences in the behavior across the different groups:</p>
<blockquote class="blockquote">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://gregordimi.com/posts/bahavioral-data-mothers-study/GraphWebCat.png" class="img-fluid figure-img"></p>
<figcaption>categories</figcaption>
</figure>
</div>
</blockquote>
<p>Across the board, the women spend most of their time on ‘Web Services’, which include social networks – followed by three other highly frequented categories: ‘Arts &amp; Entertainment’, ‘News and Media’ and ‘Shopping’.</p>
<p>We can see that women without kids spend more time browsing on ‘Travel’ websites, which might lead to the conclusion that they have more free time to spend on travel planning. Not surprisingly, they are also more active on ‘Career &amp; Education’ related websites, followed by women with older kids (12m-48m) who might think of shifting their attention back to their careers.</p>
<p>‘Sports’ related websites are dominated by women with small kids (0m-12m), maybe because they are either looking for baby sports or recovery gymnastics. We can also see that women with kids are more active on ‘Arts &amp; Entertainment’ websites – maybe because they spend more time at home as well as to entertain their kids (12m-48m).</p>
<p>Pregnant women spend more time on ‘Classifieds’ websites than the other groups which can be related to their need for baby equipment, whereas women with older kids (12m-48m) are also more active than the remaining two groups – we can assume that they start selling some of their baby equipment.</p>
<p>Even though the activities within the ‘Finance’ category don’t show huge differences between women without kids and women with kids, we saw that women without kids visit 6 times more finance related websites per week that are related to financial management (e.g.&nbsp;their banking account). On the other hand, women with kids have more visits on the financial services subcategory (e.g.&nbsp;loans). Pregnant women are not as active on finance related websites as the other groups.</p>
<section id="shopping" class="level4">
<h4 class="anchored" data-anchor-id="shopping">Shopping</h4>
<p>We also delved a bit deeper into the shopping subcategories:</p>
<blockquote class="blockquote">
<p><img src="https://gregordimi.com/posts/bahavioral-data-mothers-study/GraphCatShop.png" class="img-fluid"></p>
</blockquote>
<p>Looking into the shopping subcategories, women without kids are the most active in the ‘Fashion’ and ‘Culture’ categories, but also show high activities for ‘Tickets’, ‘Telecom’, ‘Craftwork’ and ‘Beauty &amp; Cosmetics’. Moreover, they are the only group that visited ‘Luggage Bags and Backpack’ websites. These broad shopping interests support the idea that they have more free time for themselves compared to the other groups. Not surprisingly, their activity in the ‘Baby and Kids’ category is the lowest.</p>
<p>We see that ‘Sports’, ‘Pharmacy’, ‘Marketplaces’, ‘Home Decorations’ and ‘Baby and Kids’ are more frequented by women with children younger than 1 year, who have the highest shopping activity in general. This might have to do with their interest in recovery gymnastics (Sports) and an increased need for medicaments (Pharmacy) and baby products (Marketplaces, Baby and Kids). It is interesting that they have the the lowest activity across all other categories compared to the other groups.</p>
<p>The ‘Ticket’, ‘Telecom’, ‘Office Supplies’ categories are highly dominated by women with older children. They also have slightly the highest activity on ‘Beauty &amp; Cosmetics’ websites, whereas their activity on the ‘Sports’ and ‘Home and Decoration’ shopping categories is the lowest compared to the other groups.</p>
<p>Pregnant women slightly dominate the ‘Coupons’ and ‘Supermarket’ categories, but are also quite active in the ‘Office Supplies’, ‘Home &amp; Decoration’, ‘Fashion’, ‘Culture’ and ‘Baby and Kids’ categories which implies that they need to purchase various baby equipment within different shopping categories.</p>
</section>
</section>
</section>
<section id="conclusion" class="level2">
<h2 class="anchored" data-anchor-id="conclusion">Conclusion</h2>
<p>The results provide meaningful insights into behavioral differences and priorities of millennial women. The family status has a huge impact on the intensity of activity on different weekdays and specific times as well as which website categories are frequented. The detailed insights into what the different groups do online are great opportunities for brands to not only understand when it is best to connect to each segment, but also where to reach out to them most effectively.</p>
<p>You can download the handout of our case study <a href="https://www.dropbox.com/sh/4vff5eam62p7clk/AABXZIQQ4_I53C_SIsxgMVV3a?dl=0">here</a>.</p>
<section id="references" class="level3">
<h3 class="anchored" data-anchor-id="references">References</h3>
<p><em>The post has been originally published as a marketing copy at Wakoopa’s blog <a href="https://blog.wakoopa.com/female-millennials-the-influence-of-kids-on-the-online-behavior-2/">How kids influence the online behavior of millennial women</a> on 4 November 2016</em></p>
<p>[1] Punchbowl, The World of Digital Moms: 101 Stats That Brands Need to Know</p>
<p>[2] <a href="http://www.nielsen.com/us/en/insights/news/2012/digital-lives-of-american-moms.html" class="uri">http://www.nielsen.com/us/en/insights/news/2012/digital-lives-of-american-moms.html</a></p>


</section>
</section>

 ]]></description>
  <category>data</category>
  <category>behavioral data</category>
  <guid>https://gregordimi.com/posts/bahavioral-data-mothers-study/</guid>
  <pubDate>Fri, 04 Nov 2016 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Behavioral data part - results</title>
  <link>https://gregordimi.com/posts/bahavioral-data-results/</link>
  <description><![CDATA[ 






<p>In case you have missed the first two parts, you can find them <a href="">here</a> and <a href="">here</a>.</p>
<section id="introduction" class="level2 page-columns page-full">
<h2 class="anchored" data-anchor-id="introduction">Introduction</h2>
<p>In this part, we will present the hypotheses and the main insights from the survey and the behavioral dataset on the relationship between consumers’ travel planning behavior and their personality.</p>
<p>Next to that, we will demonstrate and evaluate the performance of the model as well as where the findings can be applied in business.</p>
<p>Additionally, we will plot two respondents profiles – selected out of the data – who provide a good representation of the impact of risk and uncertainty on travel related online behavior. These profiles show their cross-device activity with the travel related online activities.</p>
<section id="sample-characteristics-and-survey-results" class="level3">
<h3 class="anchored" data-anchor-id="sample-characteristics-and-survey-results">Sample characteristics and survey results</h3>
<p>The sample of the research consists of Dutch panelists, equally distributed across gender and slightly more dominated by senior people with a median income between 39K and 66K Euro. 61% percent of the sample indicated they are the main decision makers concerning their household’s travel decisions.</p>
<p>The most visited destinations were in Europe accounting for 79% of the visits, followed by North America and Asia with 7% of visits each. Among all countries, Spain is the most popular destination with 20.5%. The domestic travel in the Netherlands accounted for 16% followed by Germany, Italy and France with approximately 10% each.</p>
<p>Based on the survey, the spread across the different segments of risk and uncertainty attitudes is as follows:</p>
<div id="7c5463ee" class="cell" data-message="false" data-execution_count="1">
<div class="cell-output cell-output-display">
<div>            <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG"></script><script>if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}</script>                <script>window.PlotlyConfig = {MathJaxConfig: 'local'};</script>
        <script charset="utf-8" src="https://cdn.plot.ly/plotly-3.5.0.min.js" integrity="sha256-fHbNLP+GlIXN+efbQec78UkemUz3NJp7UmfGxC1tNxs=" crossorigin="anonymous"></script>                <div id="5196539b-ee59-496f-b72f-0fdb74552afd" class="plotly-graph-div" style="height:525px; width:100%;"></div>            <script>                window.PLOTLYENV=window.PLOTLYENV || {};                                if (document.getElementById("5196539b-ee59-496f-b72f-0fdb74552afd")) {                    Plotly.newPlot(                        "5196539b-ee59-496f-b72f-0fdb74552afd",                        [{"hole":0.4,"labels":["Risk averse, uncertainty averse","Risk seeking, uncertainty averse","Risk averse, uncertainty seeking","Risk seeking, uncertainty seeking"],"marker":{"colors":["#FF6384","#36A2EB","#FFCE56","#4BC0C0"]},"textinfo":"percent","values":[139,127,168,13],"type":"pie"}],                        {"template":{"data":{"histogram2dcontour":[{"type":"histogram2dcontour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"choropleth":[{"type":"choropleth","colorbar":{"outlinewidth":0,"ticks":""}}],"histogram2d":[{"type":"histogram2d","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"heatmap":[{"type":"heatmap","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"contourcarpet":[{"type":"contourcarpet","colorbar":{"outlinewidth":0,"ticks":""}}],"contour":[{"type":"contour","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"surface":[{"type":"surface","colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]}],"mesh3d":[{"type":"mesh3d","colorbar":{"outlinewidth":0,"ticks":""}}],"scatter":[{"fillpattern":{"fillmode":"overlay","size":10,"solidity":0.2},"type":"scatter"}],"parcoords":[{"type":"parcoords","line":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolargl":[{"type":"scatterpolargl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"scattergeo":[{"type":"scattergeo","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterpolar":[{"type":"scatterpolar","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"scattergl":[{"type":"scattergl","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatter3d":[{"type":"scatter3d","line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattermap":[{"type":"scattermap","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattermapbox":[{"type":"scattermapbox","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scatterternary":[{"type":"scatterternary","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"scattercarpet":[{"type":"scattercarpet","marker":{"colorbar":{"outlinewidth":0,"ticks":""}}}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"white","linecolor":"white","minorgridcolor":"white","startlinecolor":"#2a3f5f"},"type":"carpet"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}],"barpolar":[{"marker":{"line":{"color":"#E5ECF6","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"pie":[{"automargin":true,"type":"pie"}]},"layout":{"autotypenumbers":"strict","colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"hovermode":"closest","hoverlabel":{"align":"left"},"paper_bgcolor":"white","plot_bgcolor":"#E5ECF6","polar":{"bgcolor":"#E5ECF6","angularaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"radialaxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"ternary":{"bgcolor":"#E5ECF6","aaxis":{"gridcolor":"white","linecolor":"white","ticks":""},"baxis":{"gridcolor":"white","linecolor":"white","ticks":""},"caxis":{"gridcolor":"white","linecolor":"white","ticks":""}},"coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]]},"xaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"yaxis":{"gridcolor":"white","linecolor":"white","ticks":"","title":{"standoff":15},"zerolinecolor":"white","automargin":true,"zerolinewidth":2},"scene":{"xaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"yaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2},"zaxis":{"backgroundcolor":"#E5ECF6","gridcolor":"white","linecolor":"white","showbackground":true,"ticks":"","zerolinecolor":"white","gridwidth":2}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"geo":{"bgcolor":"white","landcolor":"#E5ECF6","subunitcolor":"white","showland":true,"showlakes":true,"lakecolor":"white"},"title":{"x":0.05},"mapbox":{"style":"light"},"margin":{"b":0,"l":0,"r":0,"t":30}}},"legend":{"orientation":"h","yanchor":"bottom","y":-0.2,"xanchor":"center","x":0.5},"margin":{"t":20,"b":20,"l":20,"r":20},"showlegend":true},                        {"responsive": true}                    ).then(function(){
                            
var gd = document.getElementById('5196539b-ee59-496f-b72f-0fdb74552afd');
var x = new MutationObserver(function (mutations, observer) {{
        var display = window.getComputedStyle(gd).display;
        if (!display || display === 'none') {{
            console.log([gd, 'removed!']);
            Plotly.purge(gd);
            observer.disconnect();
        }}
}});

// Listen for the removal of the full notebook cells
var notebookContainer = gd.closest('#notebook-container');
if (notebookContainer) {{
    x.observe(notebookContainer, {childList: true});
}}

// Listen for the clearing of the current output cell
var outputEl = gd.closest('.output');
if (outputEl) {{
    x.observe(outputEl, {childList: true});
}}

                        })                };            </script>        </div>
</div>
</div>
</section>
<section id="main-results" class="level3 page-columns page-full">
<h3 class="anchored" data-anchor-id="main-results">Main results</h3>
<p>The main results from the analysis of the survey and behavioral data confirm most of the hypotheses that we made regarding the impact of personality in terms of risk and uncertainty on online travel related behavior.</p>
<p>Zooming into more details, the data has been analyzed from the perspective of desktop activity, mobile activity and both activities combined. The mobile dataset doesn’t contain enough observations and the variance is too low to make concrete conclusions about the mobile behavior of the participants. We have 426 participants among which we have mobile data for only 100 panelists. Therefore, the hypotheses are being confirmed based on the analysis of the desktop data. The most impressing insights are the following:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;"></th>
<th style="text-align: center;">Micro-moments</th>
<th style="text-align: center;">Domains</th>
<th style="text-align: center;">Pageviews</th>
<th style="text-align: center;">Time</th>
<th style="text-align: center;">Length</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;"><strong>Risk seeking</strong> in comparison to risk averse</td>
<td style="text-align: center;"><span style="color: #C6D7DE"><strong>-11.7%</strong></span></td>
<td style="text-align: center;"><span style="color: #C6D7DE"><strong>-19.3%</strong></span></td>
<td style="text-align: center;"><span style="color: #24AF7A"><strong>-35%</strong>*</span></td>
<td style="text-align: center;"><span style="color: #24AF7A"><strong>-48%</strong>*</span></td>
<td style="text-align: center;"><span style="color: #24AF7A"><strong>-24.3%</strong></span></td>
</tr>
<tr class="even">
<td style="text-align: left;"><strong>Uncertainty seeking</strong> in comparison to uncertainty averse</td>
<td style="text-align: center;"><span style="color: #C6D7DE"><strong>-11.2%</strong></span></td>
<td style="text-align: center;"><span style="color: #24AF7A"><strong>-23.9%</strong></span></td>
<td style="text-align: center;"><span style="color: #24AF7A"><strong>-31.8%</strong>*</span></td>
<td style="text-align: center;"><span style="color: #24AF7A"><strong>-31.3%</strong>*</span></td>
<td style="text-align: center;"><span style="color: #24AF7A"><strong>-13.8</strong>*</span></td>
</tr>
</tbody>
</table>
<aside classname="extra-info">
<p><em>p&lt;0.1; <strong>p&lt;0.05;</strong></em> p&lt;0.01</p>
</aside>
<p>
Based on the results we can confirm the following hypotheses:
</p>
<table class="caption-top table">
<colgroup>
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">Hypotheses</th>
<th style="text-align: center;">Micro-moments</th>
<th style="text-align: center;">Domains</th>
<th style="text-align: center;">Page-views</th>
<th style="text-align: center;">Time</th>
<th style="text-align: center;">Length</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">H1. Risk seeking</td>
<td style="text-align: center;"><span style="color: #ff0000"><strong>✗</strong></span></td>
<td style="text-align: center;"><span style="color: #ff0000"><strong>✗</strong></span></td>
<td style="text-align: center;"><span style="color: #24AF7A"><strong>✔</strong></span></td>
<td style="text-align: center;"><span style="color: #24AF7A"><strong>✔</strong></span></td>
<td style="text-align: center;"><span style="color: #24AF7A"><strong>✔</strong></span></td>
</tr>
<tr class="even">
<td style="text-align: left;">H2. Uncertainty seeking</td>
<td style="text-align: center;"><span style="color: #ff0000"><strong>✗</strong></span></td>
<td style="text-align: center;"><span style="color: #24AF7A"><strong>✔</strong></span></td>
<td style="text-align: center;"><span style="color: #24AF7A"><strong>✔</strong></span></td>
<td style="text-align: center;"><span style="color: #24AF7A"><strong>✔</strong></span></td>
<td style="text-align: center;"><span style="color: #24AF7A"><strong>✔</strong></span></td>
</tr>
</tbody>
</table>
<p>According to our estimation based on the analysis we can compare consumers who made 3 bookings per year, are highly active online and differ in risk and uncertainty attitudes. Here is how their personality would impact the travel planning activities for one year:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;"></th>
<th style="text-align: center;">Micro-moments</th>
<th style="text-align: center;">Domains</th>
<th style="text-align: center;">Pageviews</th>
<th style="text-align: center;">Time in hours</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;"><strong>Risk and uncertainty seeking</strong></td>
<td style="text-align: center;"><span style="color: #C6D7DE"><strong>420</strong></span></td>
<td style="text-align: center;"><span style="color: #C6D7DE"><strong>148</strong></span></td>
<td style="text-align: center;"><span style="color: #24AF7A"><strong>1484</strong></span></td>
<td style="text-align: center;"><span style="color: #24AF7A"><strong>11</strong></span></td>
</tr>
<tr class="even">
<td style="text-align: left;"><strong>Risk averse and uncertainty seeking</strong></td>
<td style="text-align: center;"><span style="color: #C6D7DE"><strong>492</strong></span></td>
<td style="text-align: center;"><span style="color: #C6D7DE"><strong>188</strong></span></td>
<td style="text-align: center;"><span style="color: #24AF7A"><strong>2250</strong></span></td>
<td style="text-align: center;"><span style="color: #24AF7A"><strong>17</strong></span></td>
</tr>
<tr class="odd">
<td style="text-align: left;"><strong>Risk seeking and uncertainty averse</strong></td>
<td style="text-align: center;"><span style="color: #C6D7DE"><strong>489</strong></span></td>
<td style="text-align: center;"><span style="color: #C6D7DE"><strong>192</strong></span></td>
<td style="text-align: center;"><span style="color: #24AF7A"><strong>2028</strong></span></td>
<td style="text-align: center;"><span style="color: #24AF7A"><strong>15</strong></span></td>
</tr>
<tr class="even">
<td style="text-align: left;"><strong>Risk and uncertainty averse</strong></td>
<td style="text-align: center;"><span style="color: #C6D7DE"><strong>574</strong></span></td>
<td style="text-align: center;"><span style="color: #C6D7DE"><strong>245</strong></span></td>
<td style="text-align: center;"><span style="color: #24AF7A"><strong>3075</strong></span></td>
<td style="text-align: center;"><span style="color: #24AF7A"><strong>24</strong></span></td>
</tr>
</tbody>
</table>
</section>
<section id="example-profiles" class="level3">
<h3 class="anchored" data-anchor-id="example-profiles">Example profiles</h3>
<p>In order to present to you how the risk and uncertainty impacts the online travel behavior we will introduce two real people from the data. The names have been changed to protect the persons’ personalities.</p>
<p><strong>Meet Marilou.</strong> She is a 34 year-old woman from Limburg. She earns above average income and she is highly active online in comparison to her peers. Marilou is an open-minded person with an outgoing personality. She is a social person with a lot of friends. She is curious and open to new experiences, however she holds a strong opinion about her beliefs and she tends to be suspicious. Marilou is both averse towards risk and uncertainty. She spends a big proportion of her time deciding on her travel activities, including searching for and comparing hotels. Apart from this, she also uses travel magazines in order to support her decisions. Marilou went on a leisure trip to the US with her significant other. She spent more than half a year on the planning her 18 nights stay even though she has been there twice before. She ordered everything online including flights, transportation, accommodations and entertainment. They spent approximately 3,000 EUR per person on the whole trip including transport and hotels.</p>
<p><strong>Here is Marilou’s activity on travel related websites as a proportion from her total online activity, both on mobile and desktop.</strong></p>
<div id="fa1fa5a8" class="cell" data-message="false" data-execution_count="2">
<div class="cell-output cell-output-display">
<div>            <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG"></script><script>if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}</script>                <script>window.PlotlyConfig = {MathJaxConfig: 'local'};</script>
        <script charset="utf-8" src="https://cdn.plot.ly/plotly-3.5.0.min.js" integrity="sha256-fHbNLP+GlIXN+efbQec78UkemUz3NJp7UmfGxC1tNxs=" crossorigin="anonymous"></script>                <div id="7b47cc5f-c596-4ed9-a145-c7491008f5bd" class="plotly-graph-div" style="height:525px; width:100%;"></div>            <script>                window.PLOTLYENV=window.PLOTLYENV || {};                                if (document.getElementById("7b47cc5f-c596-4ed9-a145-c7491008f5bd")) {                    Plotly.newPlot(                        "7b47cc5f-c596-4ed9-a145-c7491008f5bd",                        [{"line":{"color":"#DC143C","dash":"solid","width":2},"marker":{"size":4},"mode":"lines+markers","name":"Desktop, Travel Micro-moments","visible":true,"x":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30],"y":[0,60,33.33,15.79,35.29,46.15,50,30.77,21.43,15.38,15.79,42.86,0,38.46,50,60,20,10,11.54,50,25,31.58,0,20,0,0,100,33.33,0,0],"type":"scatter"},{"line":{"color":"#1E90FF","dash":"solid","width":2},"marker":{"size":4},"mode":"lines+markers","name":"Desktop, Travel Pageviews","visible":true,"x":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30],"y":[0,29.49,16.48,1.48,28.32,27.04,6.63,5.16,6.23,2.82,2.07,39.87,0,8.91,8.97,12.22,10.69,4.81,1.78,12.23,33.27,3.67,0,25.92,0,0,20.25,27.98,0,0],"type":"scatter"},{"line":{"color":"#228B22","dash":"solid","width":2},"marker":{"size":4},"mode":"lines+markers","name":"Desktop, Travel Time","visible":true,"x":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30],"y":[0,33.83,15.88,0.73,23.78,22.37,8.39,4.92,5.76,2.63,2.99,52.71,0,7.68,9.65,9.13,11.04,4.91,2.96,9.6,39.14,4.89,0,22.86,0,0,22.72,45.57,0,0],"type":"scatter"},{"line":{"color":"#FFD700","dash":"solid","width":2},"marker":{"size":4},"mode":"lines+markers","name":"Desktop, Travel Domains","visible":true,"x":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30],"y":[0,35.12,15.77,4.2,22.37,16,11.59,8.23,5.85,2.49,2.39,13,0,10.79,7.64,12.28,9.43,4.69,1.86,14.52,12.14,6.72,0,16.18,0,0,30.19,12.5,0,0],"type":"scatter"},{"line":{"color":"#00BFFF","dash":"dash","width":2},"marker":{"size":4},"mode":"lines+markers","name":"Mobile, Travel Micro-moments","visible":"legendonly","x":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30],"y":[28.57,25.71,14.39,11.54,20.39,23.81,17.82,8.63,10.26,20.49,12.28,5.93,22.34,16,24.3,21.43,18.4,28.04,13.71,16.39,16.51,22.54,3.23,22.14,27.71,29.5,36.73,16.39,13.89,0],"type":"scatter"},{"line":{"color":"#D2691E","dash":"dash","width":2},"marker":{"size":4},"mode":"lines+markers","name":"Mobile, Travel Pageviews","visible":"legendonly","x":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30],"y":[4.91,9.85,14.57,1.87,9.63,5.31,5.88,3.94,3.44,5.15,2.41,1.83,6,5,4.79,4.83,8.82,9.52,2.95,6.34,6.4,5.81,0.71,4.57,3.87,13.07,21.41,4.58,3.52,0],"type":"scatter"},{"line":{"color":"#BA55D3","dash":"dash","width":2},"marker":{"size":4},"mode":"lines+markers","name":"Mobile, Travel Time","visible":"legendonly","x":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30],"y":[1.39,6.77,6.82,1.4,5.89,4.01,2.77,3.89,1.14,2.75,1.88,0.79,7.45,1.64,5.06,5.58,7.92,9.89,2.24,3.56,4.7,5.52,0.23,2.17,2.87,7.32,20.07,3.55,2.92,0],"type":"scatter"},{"line":{"color":"#FF6347","dash":"dash","width":2},"marker":{"size":4},"mode":"lines+markers","name":"Mobile, Travel Domains & Apps","visible":"legendonly","x":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30],"y":[3.12,7.73,8.65,3.12,5.56,4.33,3.6,2.06,3.42,5.92,3.25,2.01,6.1,3.61,5.95,4.38,6.2,8.19,2.88,3.26,4.88,4.7,0.87,6.24,5.11,12.32,12.49,5.72,3.9,0],"type":"scatter"}],                        {"template":{"data":{"barpolar":[{"marker":{"line":{"color":"white","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"white","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"#C8D4E3","linecolor":"#C8D4E3","minorgridcolor":"#C8D4E3","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"#C8D4E3","linecolor":"#C8D4E3","minorgridcolor":"#C8D4E3","startlinecolor":"#2a3f5f"},"type":"carpet"}],"choropleth":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"choropleth"}],"contourcarpet":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"contourcarpet"}],"contour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"contour"}],"heatmap":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmap"}],"histogram2dcontour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2dcontour"}],"histogram2d":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2d"}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"mesh3d":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"mesh3d"}],"parcoords":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"parcoords"}],"pie":[{"automargin":true,"type":"pie"}],"scatter3d":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatter3d"}],"scattercarpet":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattercarpet"}],"scattergeo":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergeo"}],"scattergl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergl"}],"scattermapbox":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattermapbox"}],"scattermap":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattermap"}],"scatterpolargl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolargl"}],"scatterpolar":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolar"}],"scatter":[{"fillpattern":{"fillmode":"overlay","size":10,"solidity":0.2},"type":"scatter"}],"scatterternary":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterternary"}],"surface":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"surface"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}]},"layout":{"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"autotypenumbers":"strict","coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]],"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]},"colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"geo":{"bgcolor":"white","lakecolor":"white","landcolor":"white","showlakes":true,"showland":true,"subunitcolor":"#C8D4E3"},"hoverlabel":{"align":"left"},"hovermode":"closest","mapbox":{"style":"light"},"margin":{"b":0,"l":0,"r":0,"t":30},"paper_bgcolor":"white","plot_bgcolor":"white","polar":{"angularaxis":{"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":""},"bgcolor":"white","radialaxis":{"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":""}},"scene":{"xaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"},"yaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"},"zaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"ternary":{"aaxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""},"baxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""},"bgcolor":"white","caxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""}},"title":{"x":0.05},"xaxis":{"automargin":true,"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":"","title":{"standoff":15},"zerolinecolor":"#EBF0F8","zerolinewidth":2},"yaxis":{"automargin":true,"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":"","title":{"standoff":15},"zerolinecolor":"#EBF0F8","zerolinewidth":2}}},"legend":{"orientation":"h","yanchor":"bottom","y":-0.5,"xanchor":"center","x":0.5},"margin":{"l":40,"r":40,"t":20,"b":100},"xaxis":{"title":{"text":"Week"}},"yaxis":{"title":{"text":"Percentage of travel-related activity (%)"}},"hovermode":"x unified"},                        {"responsive": true}                    ).then(function(){
                            
var gd = document.getElementById('7b47cc5f-c596-4ed9-a145-c7491008f5bd');
var x = new MutationObserver(function (mutations, observer) {{
        var display = window.getComputedStyle(gd).display;
        if (!display || display === 'none') {{
            console.log([gd, 'removed!']);
            Plotly.purge(gd);
            observer.disconnect();
        }}
}});

// Listen for the removal of the full notebook cells
var notebookContainer = gd.closest('#notebook-container');
if (notebookContainer) {{
    x.observe(notebookContainer, {childList: true});
}}

// Listen for the clearing of the current output cell
var outputEl = gd.closest('.output');
if (outputEl) {{
    x.observe(outputEl, {childList: true});
}}

                        })                };            </script>        </div>
</div>
</div>
<p><strong>Meet Sophie.</strong> She is a 27 year-old woman from South Holland. She earns above average income and she is not very active on the internet compared to the rest of the sample, however, she uses a lot of different sources of information. Sophie is very kind and trustworthy, perhaps a bit naive, sometimes a bit spontaneous, yet she is a stable individual. Sophie is averse towards risk, but uncertainty seeking. Although she was the main decision maker regarding her trip and she uses only internet for planning, she didn’t spend that big of a proportion of her time to decide on her travel activities comparing to Marilou. Sophie went on a short trip to the US with one more person. She spent only a week to plan her trip. She ordered accommodations and entertainment online. They spent approximately 900 EUR per person on the whole trip including transportation and accommodations.</p>
<p><strong>Here is Sophie’s activity on travel related websites as a proportion from her total online activity, both on mobile and desktop.</strong></p>
<div id="d6732b3c" class="cell" data-message="false" data-execution_count="3">
<div class="cell-output cell-output-display">
<div>            <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_SVG"></script><script>if (window.MathJax && window.MathJax.Hub && window.MathJax.Hub.Config) {window.MathJax.Hub.Config({SVG: {font: "STIX-Web"}});}</script>                <script>window.PlotlyConfig = {MathJaxConfig: 'local'};</script>
        <script charset="utf-8" src="https://cdn.plot.ly/plotly-3.5.0.min.js" integrity="sha256-fHbNLP+GlIXN+efbQec78UkemUz3NJp7UmfGxC1tNxs=" crossorigin="anonymous"></script>                <div id="1e7a4915-92b8-4c5b-93d5-082b15df869c" class="plotly-graph-div" style="height:500px; width:100%;"></div>            <script>                window.PLOTLYENV=window.PLOTLYENV || {};                                if (document.getElementById("1e7a4915-92b8-4c5b-93d5-082b15df869c")) {                    Plotly.newPlot(                        "1e7a4915-92b8-4c5b-93d5-082b15df869c",                        [{"line":{"color":"#DC143C","dash":"solid","width":2},"marker":{"size":4},"mode":"lines+markers","name":"Desktop, Travel Micro-moments","visible":true,"x":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30],"y":[66.67,100,83.33,52.38,36,58.33,62.5,43.75,57.14,43.75,25.81,33.33,28.57,40,75,31.25,45.45,55.56,55.56,37.5,100,38.46,50,53.85,70,100,50,38.1,80,0],"type":"scatter"},{"line":{"color":"#1E90FF","dash":"solid","width":2},"marker":{"size":4},"mode":"lines+markers","name":"Desktop, Travel Pageviews","visible":true,"x":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30],"y":[5.1,7.11,1.43,10.71,8.14,4.11,2,2.43,6.8,6.84,3.36,1.17,1.46,9.72,5.3,1.13,0.48,1.43,2.16,0.25,1.96,1.22,0.78,5.19,13.36,5.96,6.69,9.96,1.9,0],"type":"scatter"},{"line":{"color":"#228B22","dash":"solid","width":2},"marker":{"size":4},"mode":"lines+markers","name":"Desktop, Travel Time","visible":true,"x":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30],"y":[24.44,6.13,0.94,12.92,4.77,3,1.79,1.9,9.7,4.63,0.94,1.91,1.63,10.06,7.1,0.42,0.26,1.17,0.62,1.16,2.27,1.01,0.33,3.04,15.58,5.95,8.96,5.42,1.87,0],"type":"scatter"},{"line":{"color":"#FFD700","dash":"solid","width":2},"marker":{"size":4},"mode":"lines+markers","name":"Desktop, Travel Domains","visible":true,"x":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30],"y":[18.52,9.62,11.9,11.11,11.21,10.26,12.07,10.31,14.12,13.25,9.89,9.3,5.56,14.88,14.52,8.7,4.9,5.49,7.27,3,8.79,5.11,5,13.56,17.82,9.09,10.31,8.21,8.51,0],"type":"scatter"},{"line":{"color":"#00BFFF","dash":"dash","width":2},"marker":{"size":4},"mode":"lines+markers","name":"Mobile, Travel Micro-moments","visible":"legendonly","x":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30],"y":[0,7.14,9.09,0,8.7,0,0,3.23,14.29,0,13.33,13.04,0,22.58,0,0,0,0,5.56,3.57,5.26,0,10,25,11.54,0,0,4,0,33.33],"type":"scatter"},{"line":{"color":"#D2691E","dash":"dash","width":2},"marker":{"size":4},"mode":"lines+markers","name":"Mobile, Travel Pageviews","visible":"legendonly","x":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30],"y":[0,5.71,17.39,0,34.38,0,0,0.75,6.67,0,3.45,21.21,0,15.44,0,0,0,0,4,47.83,0.97,0,4.55,26.25,22.09,0,0,4,0,27.78],"type":"scatter"},{"line":{"color":"#BA55D3","dash":"dash","width":2},"marker":{"size":4},"mode":"lines+markers","name":"Mobile, Travel Time","visible":"legendonly","x":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30],"y":[0,11.55,7.71,0,17.8,0,0,2.02,3.34,0,2.12,20.34,0,11.97,0,0,0,0,0.94,14.5,0.45,0,0.27,10.32,13.1,0,0,1.41,0,21.23],"type":"scatter"},{"line":{"color":"#FF6347","dash":"dash","width":2},"marker":{"size":4},"mode":"lines+markers","name":"Mobile, Travel Domains & Apps","visible":"legendonly","x":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30],"y":[0,4,13.33,0,12.5,0,0,2.17,22.22,0,10.53,12.5,0,17.07,0,0,0,0,6.25,7.69,12.5,0,12.5,22.22,12.12,0,0,3.7,0,40],"type":"scatter"}],                        {"template":{"data":{"barpolar":[{"marker":{"line":{"color":"white","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"barpolar"}],"bar":[{"error_x":{"color":"#2a3f5f"},"error_y":{"color":"#2a3f5f"},"marker":{"line":{"color":"white","width":0.5},"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"bar"}],"carpet":[{"aaxis":{"endlinecolor":"#2a3f5f","gridcolor":"#C8D4E3","linecolor":"#C8D4E3","minorgridcolor":"#C8D4E3","startlinecolor":"#2a3f5f"},"baxis":{"endlinecolor":"#2a3f5f","gridcolor":"#C8D4E3","linecolor":"#C8D4E3","minorgridcolor":"#C8D4E3","startlinecolor":"#2a3f5f"},"type":"carpet"}],"choropleth":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"choropleth"}],"contourcarpet":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"contourcarpet"}],"contour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"contour"}],"heatmap":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"heatmap"}],"histogram2dcontour":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2dcontour"}],"histogram2d":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"histogram2d"}],"histogram":[{"marker":{"pattern":{"fillmode":"overlay","size":10,"solidity":0.2}},"type":"histogram"}],"mesh3d":[{"colorbar":{"outlinewidth":0,"ticks":""},"type":"mesh3d"}],"parcoords":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"parcoords"}],"pie":[{"automargin":true,"type":"pie"}],"scatter3d":[{"line":{"colorbar":{"outlinewidth":0,"ticks":""}},"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatter3d"}],"scattercarpet":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattercarpet"}],"scattergeo":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergeo"}],"scattergl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattergl"}],"scattermapbox":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattermapbox"}],"scattermap":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scattermap"}],"scatterpolargl":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolargl"}],"scatterpolar":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterpolar"}],"scatter":[{"fillpattern":{"fillmode":"overlay","size":10,"solidity":0.2},"type":"scatter"}],"scatterternary":[{"marker":{"colorbar":{"outlinewidth":0,"ticks":""}},"type":"scatterternary"}],"surface":[{"colorbar":{"outlinewidth":0,"ticks":""},"colorscale":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"type":"surface"}],"table":[{"cells":{"fill":{"color":"#EBF0F8"},"line":{"color":"white"}},"header":{"fill":{"color":"#C8D4E3"},"line":{"color":"white"}},"type":"table"}]},"layout":{"annotationdefaults":{"arrowcolor":"#2a3f5f","arrowhead":0,"arrowwidth":1},"autotypenumbers":"strict","coloraxis":{"colorbar":{"outlinewidth":0,"ticks":""}},"colorscale":{"diverging":[[0,"#8e0152"],[0.1,"#c51b7d"],[0.2,"#de77ae"],[0.3,"#f1b6da"],[0.4,"#fde0ef"],[0.5,"#f7f7f7"],[0.6,"#e6f5d0"],[0.7,"#b8e186"],[0.8,"#7fbc41"],[0.9,"#4d9221"],[1,"#276419"]],"sequential":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]],"sequentialminus":[[0.0,"#0d0887"],[0.1111111111111111,"#46039f"],[0.2222222222222222,"#7201a8"],[0.3333333333333333,"#9c179e"],[0.4444444444444444,"#bd3786"],[0.5555555555555556,"#d8576b"],[0.6666666666666666,"#ed7953"],[0.7777777777777778,"#fb9f3a"],[0.8888888888888888,"#fdca26"],[1.0,"#f0f921"]]},"colorway":["#636efa","#EF553B","#00cc96","#ab63fa","#FFA15A","#19d3f3","#FF6692","#B6E880","#FF97FF","#FECB52"],"font":{"color":"#2a3f5f"},"geo":{"bgcolor":"white","lakecolor":"white","landcolor":"white","showlakes":true,"showland":true,"subunitcolor":"#C8D4E3"},"hoverlabel":{"align":"left"},"hovermode":"closest","mapbox":{"style":"light"},"margin":{"b":0,"l":0,"r":0,"t":30},"paper_bgcolor":"white","plot_bgcolor":"white","polar":{"angularaxis":{"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":""},"bgcolor":"white","radialaxis":{"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":""}},"scene":{"xaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"},"yaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"},"zaxis":{"backgroundcolor":"white","gridcolor":"#DFE8F3","gridwidth":2,"linecolor":"#EBF0F8","showbackground":true,"ticks":"","zerolinecolor":"#EBF0F8"}},"shapedefaults":{"line":{"color":"#2a3f5f"}},"ternary":{"aaxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""},"baxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""},"bgcolor":"white","caxis":{"gridcolor":"#DFE8F3","linecolor":"#A2B1C6","ticks":""}},"title":{"x":0.05},"xaxis":{"automargin":true,"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":"","title":{"standoff":15},"zerolinecolor":"#EBF0F8","zerolinewidth":2},"yaxis":{"automargin":true,"gridcolor":"#EBF0F8","linecolor":"#EBF0F8","ticks":"","title":{"standoff":15},"zerolinecolor":"#EBF0F8","zerolinewidth":2}}},"legend":{"orientation":"h","yanchor":"bottom","y":-0.5,"xanchor":"center","x":0.5},"margin":{"l":40,"r":40,"t":20,"b":100},"xaxis":{"title":{"text":"Week"}},"yaxis":{"title":{"text":"Percentage of travel-related activity (%)"}},"hovermode":"x unified","height":500},                        {"responsive": true}                    ).then(function(){
                            
var gd = document.getElementById('1e7a4915-92b8-4c5b-93d5-082b15df869c');
var x = new MutationObserver(function (mutations, observer) {{
        var display = window.getComputedStyle(gd).display;
        if (!display || display === 'none') {{
            console.log([gd, 'removed!']);
            Plotly.purge(gd);
            observer.disconnect();
        }}
}});

// Listen for the removal of the full notebook cells
var notebookContainer = gd.closest('#notebook-container');
if (notebookContainer) {{
    x.observe(notebookContainer, {childList: true});
}}

// Listen for the clearing of the current output cell
var outputEl = gd.closest('.output');
if (outputEl) {{
    x.observe(outputEl, {childList: true});
}}

                        })                };            </script>        </div>
</div>
</div>
<p>The two graphs clearly indicate the impact on the travel related behavior and the difference between uncertainty averse and seeking attitude. They match with the finding that in terms of micro-moments there is no significant difference between both constructs. In terms of time and pageviews, the aversion plays a big role and increased them significantly comparing Marilou and Sophie.</p>
<p>Furthermore, one can see there are similarities between desktop and mobile behavior, perhaps slightly lagged. Also it is obvious that the graphs of Marilou and Sophie have several common peaks at weeks 1, 6, 14, 20 and 26. We can speculate that this activity is related to promotional activities from a travel service provider happening at the same time.</p>
</section>
</section>
<section id="conclusion-and-recommendation" class="level2">
<h2 class="anchored" data-anchor-id="conclusion-and-recommendation">Conclusion and recommendation</h2>
<p>Behavioral data gives us an amazing capacity to understand the online behavior of the consumers as never before. This research confirms the finding from Quintal (2010) <sup>1</sup> in the area that the attitude towards uncertainty, but not risk is responsible for choosing a number of sources (in our case in terms of domains) used for travel decision making. Our findings further contribute to the area through passive metering by investigating the time people spend on travel websites, as well as the efforts in terms of pageviews. The results from the analysis strongly confirm our hypotheses that both risk and uncertainty attitudes account for changes in time and pageviews spent desktop devices.</p>
<p>The findings are applicable to online travel stakeholders in order to better target the consumer. For example, personalized advertising is an approach widely used by the big travel websites. The insights revealed by this research can help businesses craft better personalized communication and target the right content in the right time to the right consumer.<br>
Based on the behavioral data, a service provider can estimate the profile of the consumer in terms of risk and uncertainty attitudes. Once this profiling information is available, consumers can be targeted with a message containing appealing offers based on their profile. Furthermore, the message can be delivered within a time interval when the probability to book is the highest, which could potentially result in better conversion.</p>
<p>In conclusion, we can determine from the analysis that mobile and desktop behavior differ at large and they have to be combined in order to produce meaningful insights. Yet, due to the difference in the behavior over both types of devices, there are important differences that have to be acknowledged. For example, we were able to detect bookings for each participant only over desktop device and only one purchase over mobile. In this case study the hypotheses were confirmed over the desktop activity. As a recommendation for future research we recommend more extensive research over mobile devices as we had only 25% of the sample using both mobile and desktop.</p>
<section id="limitations" class="level3">
<h3 class="anchored" data-anchor-id="limitations">Limitations</h3>
<p>An important limitation of this research that has to be acknowledged is the fact that risk and uncertainty have been assessed on scales used to measure “General risk and uncertainty attitudes” as we aimed to keep the questionnaire as short as possible. Decisions under risk and uncertainty is a big branch of science that offers advanced measurement techniques, such as lotteries and bets. Furthermore, there is evidence that domain specific risk attitude can differ from general risk attitude, therefore measuring perceived risk and uncertainty towards travel can also add up to this research.</p>
<p>You can download the handout of our case study <a href="https://www.dropbox.com/s/peouo3tx5o5h4kl/20161020%20Case%20study%20travel.pdf?dl=0">here</a>.</p>
</section>
<section id="references" class="level3">
<h3 class="anchored" data-anchor-id="references">References</h3>
<p><em>The post has been originally published as a marketing copy at Wakoopa’s blog <a href="https://blog.wakoopa.com/how-behavioral-data-sheds-light-on-real-consumers-travel-planning-behavior-part-iii/">How behavioral data sheds light on real consumers’ travel planning behavior – Part III</a> on 16 September 2016</em></p>


</section>
</section>


<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>Quintal, V. A., Lee, J. A., &amp; Soutar, G. N. (2010). Tourists’ information search: The differential impact of risk and uncertainty avoidance. International Journal of Tourism Research, 12(4), 321–333.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>data</category>
  <category>behavioral data</category>
  <guid>https://gregordimi.com/posts/bahavioral-data-results/</guid>
  <pubDate>Fri, 16 Sep 2016 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Behavioral data part - data</title>
  <link>https://gregordimi.com/posts/bahavioral-data-data/</link>
  <description><![CDATA[ 






<p>As announced <a href="test">here</a>, we will share more details on the execution of the study as well as on the results from the behavioral sampling.</p>
<section id="targeting-the-relevant-sample-for-the-survey" class="level3">
<h3 class="anchored" data-anchor-id="targeting-the-relevant-sample-for-the-survey">Targeting the relevant sample for the survey</h3>
<p>To ensure a high relevance of the sample, we passively collected the panelists<sup>1</sup> online behavior from one of our <a href="https://wakoopa.com/get-data">continuously passively measured panels</a>. We used the behavioral data to select and invite only research participants who have recently purchased a travel related product or service.</p>
<p>The data was analyzed towards website visits on purchase confirmation pages of 43 popular travel websites. This allowed us to filter out 1,039 panelists who recently <sup>2</sup> conducted a purchase.</p>
</section>
<section id="asking-what-cant-be-observed-with-passive-metering" class="level3">
<h3 class="anchored" data-anchor-id="asking-what-cant-be-observed-with-passive-metering">Asking what can’t be observed with passive metering</h3>
<p>The selected sample was invited to complete a survey covering 3 areas:</p>
<ul>
<li>Screening: The first section of the survey contained screening questions, such as questions about recent travel purchases, the role in decision making and the purpose of the trip.</li>
<li>Trip characteristics: The second part of the survey asked participants about their trip characteristics related to the latest purchase to collect information about the destination, the budget, the number of companions/children on the trip as well as offline information sources used.</li>
<li>Personality: The last section surveyed the unobservable personality related to the respondents attitude toward risk and uncertainty. We ran a factor analysis on the personality questions which helped us to separate risk from uncertainty attitudes.</li>
</ul>
</section>
<section id="the-results-from-the-fieldwork" class="level3">
<h3 class="anchored" data-anchor-id="the-results-from-the-fieldwork">The results from the fieldwork</h3>
<p>The targeted sample (n=1,039) resulted in a response rate of 84% (872 started the survey<sup>3</sup> out of 1,039 invitation sent) and an incidence rate of 68% (495 completed, additional 233 screened out because they didn’t have a major role in the decision making or went to a business trip only). The expected incidence rate for our target sample provided by our panel supplier was 20%.</p>
<p><img src="https://gregordimi.com/posts/bahavioral-data-data/funnel.png" alt="funnel" width="600" height="400"></p>
<p><strong><em>Benefits of targeting your sample with behavioral data</em></strong></p>
<ul>
<li><p><em>Relevant surveys: Sending surveys with relevant content to your respondents yields a higher satisfaction rate and an increased response rate. Moreover, more relevant surveys can lead to more accurate findings because of a higher engagement of the respondents</em>.</p></li>
<li><p><em>Lower costs: Choosing precisely the sample you want based on observed behavior can increase the incidence rate and lower the fieldwork costs.</em></p></li>
</ul>
<hr>
</section>
<section id="data-processing-and-data-analysis" class="level3">
<h3 class="anchored" data-anchor-id="data-processing-and-data-analysis">Data processing and data analysis</h3>
<p>As an additional quality check we cleaned the data on the following criteria: Respondents that were flatliners, speeding throughout the survey, attempted to participate in the survey more than once or had a low activity and insufficient observations (&lt;1,000 observation in the behavioral data), were filtered out.</p>
<p>Thus, the final dataset for the analysis, consisted of 426 active participants on desktop, 109 active on mobile and 99 among them overlapping on both devices.</p>
<blockquote class="blockquote">
<p>22 million desktop observations</p>
<p>0.8 million mobile observations</p>
</blockquote>
<p>We analyzed the full online behavior of the selected survey participants over the previous six months and categorized 194,534 unique domains visited by the participants into 16 industry categories, including the travel industry.</p>
<p>By using machine learning algorithms, the content of the websites was categorized, whether it was travel related or not. The results of the categorization showed 7,207 (3.7%) unique travel related websites.</p>
<p>The mobile apps were categorized through a list of keywords to evaluate whether an app is travel related or not. Out of 1,574 unique apps, 45 (2.9%) were associated with travel.</p>
</section>
<section id="data-fusion-combining-observed-and-declared-data" class="level3">
<h3 class="anchored" data-anchor-id="data-fusion-combining-observed-and-declared-data">Data fusion: Combining observed and declared data</h3>
<p>In order to merge the behavioral data streams from desktop and mobile with the survey data, we analyzed the data regarding different variables to understand the relationship between travel planning behavior and personality:</p>
<ul>
<li>Time spent on travel related domains</li>
<li>Total pageviews on travel related domains</li>
<li>Number of travel related unique domains</li>
<li>Number of travel related micro-moments</li>
</ul>
<p>These variables were put into relation with a set of independent variables, including the personality traits and trip characteristics from the survey, in order to reveal the impact of each factor and uncover the different consumer journeys.</p>
</section>
<section id="stay-tuned-for-the-results" class="level3">
<h3 class="anchored" data-anchor-id="stay-tuned-for-the-results">Stay tuned for the results</h3>
<p>We will share interesting insights on the relationship between consumers’ travel planning behavior and their personality as well as learnings from this research approach in the third part.</p>
</section>
<section id="reference" class="level3">
<h3 class="anchored" data-anchor-id="reference">Reference</h3>
<p><em>The post has been originally published as a marketing at Wakoopa’s blog <a href="https://blog.wakoopa.com/how-behavioral-data-sheds-light-on-real-consumers-travel-planning-behavior-part-ii/">How behavioral data sheds light on real consumers’ travel planning behavior – Part II</a> on 17 August 2016</em></p>


</section>


<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>The research was conducted using sample from the Netherlands↩︎</p></li>
<li id="fn2"><p>conducted during the last week of June 2016↩︎</p></li>
<li id="fn3"><p>between March 1, 2016 to June 16, 2016↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>behavioral data</category>
  <guid>https://gregordimi.com/posts/bahavioral-data-data/</guid>
  <pubDate>Wed, 17 Aug 2016 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Behavioral data part - intro</title>
  <dc:creator>Grigor Dimitrov</dc:creator>
  <link>https://gregordimi.com/posts/bahavioral-data-intro/</link>
  <description><![CDATA[ 






<p>The importance of the Internet for the highly competitive travel industry has increased significantly in the past year. The Internet has become an established touch point within the consumer decision journey and path to purchase – from researching information up to the purchase of travel-related goods and services. Consumers use numerous digital sources and switch across multiple devices<sup>1</sup>. For instance, they use a mobile app for travel inspiration, conduct extensive information search on another device, but commit to the purchase weeks later on their desktop device.</p>
<p>Most research is conducted by only collecting opinion data that is declared in surveys – and this also applies for the travel industry. However, declared data can’t reflect the actual online behavior of consumers. Due to this complexity, fragmentation and volume of online activities, consumers are not able to recall all their <a href="https://www.thinkwithgoogle.com/articles/travel-trends-4-mobile-moments-changing-consumer-journey.html">‘micro-moments’</a> that occur within the travel planning process:</p>
<p><img src="https://gregordimi.com/posts/bahavioral-data-intro/travel-micro-moments.png" alt="Micro-Moments" width="800" height="800"> <em>(image: <a href="https://www.thinkwithgoogle.com/consumer-insights/consumer-trends/micro-moments-travel-customer-journey/">Google</a>)</em></p>
<p>This is one reason, why researchers need to consider additional data sources to capture all the events related to a purchase decision.</p>
<p>Next to that, consumers are not loyal to a specific brand within their customer lifecycle of travel planning. Instead, they rather focus on their needs within the travel planning process<sup>2</sup>. This makes a good understanding of the ‘micro-moments’ essential for brands, so they are able to create great customer experience and turn it into an competitive advantage.</p>
<section id="what-can-we-do-better" class="level3">
<h3 class="anchored" data-anchor-id="what-can-we-do-better">What can we do better?</h3>
<p>One possibility to improve the research quality is to move away from self-reported, recalled and <a href="https://blog.wakoopa.com/the-times-they-are-a-changin-for-the-questionnaire/">biased information</a> and move towards objective, passively measured data. A great example for this is to collect behavioral data with passive metering technology, since it is able to capture the full footprint of consumers across their devices. This data can help us to understand the time spent with travel planning as well as the amount of information researched with great accuracy and detail.</p>
<p>On the other hand, we can’t measure personality through passive metering – this is where survey data is still important and valuable. Merging behavioral data with other data sources (e.g.&nbsp;declared information on demographics or personality) provides an even deeper layer of insight into the travel planning behavior of different consumer segments.</p>
</section>
<section id="the-research-objective" class="level3">
<h3 class="anchored" data-anchor-id="the-research-objective">The research objective</h3>
<p>There is evidence that there is a correlation between travel online behavior and the risk and uncertainty attitude of consumers, but this has been researched with declared data alone. To get a better understanding on the relationship between the efforts (measured in domains, time, page-views and micro-moments) people make researching for travel alternatives with their personality, we decided to explore the following research question:</p>
<blockquote class="blockquote">
<p>What is the relationship between consumer’s travel planning behavior and their personality?</p>
</blockquote>
<p>Our goal is to uncover, whether a risk and uncertainty averseness drives people to invest more time researching online for their travels and on the other hand, if risk and uncertainty seeking people invest less time online with researching for their travels.</p>
<p>Based on the findings, this study aims to result in a tangible example on how behavioral data can unlock consumer reality for the travel industry and to provide insights for brands on how consumer experiences (e.g.&nbsp;better targeting &amp; personalized offerings) can be improved.</p>
</section>
<section id="the-research-design" class="level3">
<h3 class="anchored" data-anchor-id="the-research-design">The research design</h3>
<p>We decided to approach our research objective with an innovative, multi-source research design by integrating behavioral data with declared data.</p>
<p>In the first step, we will use passive metering as a targeting tool for a survey sample. Selecting a relevant sample for your research is of crucial importance for accurately answering your research questions and gaining relevant insights.</p>
<p>In the next phase, the selected sample will be invited to complete a survey on their demographics, trip characteristics, travel behavior and personality. The survey data will be analyzed, categorized and integrated with the full online behavior of the survey participants to uncover differences in their customer journeys.</p>
</section>
<section id="whats-next" class="level3">
<h3 class="anchored" data-anchor-id="whats-next">What’s next?</h3>
<p>In the following posts we will provide more information on the data analysis, segmentation and on how the different data streams were merged together.</p>
<p>We will elaborate on the results from the behavioral sample targeting and share the research findings as well as the generated learnings from this research approach.</p>
</section>
<section id="references" class="level3">
<h3 class="anchored" data-anchor-id="references">References</h3>
<p><em>The post has been originally published as a marketing at Wakoopa’s blog <a href="https://blog.wakoopa.com/how-behavioral-data-sheds-light-on-real-consumers-travel-planning-behavior-part-i-2/">How behavioral data sheds light on real consumers’ travel planning behavior – Part I</a> on 4 August 2016</em></p>


</section>


<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>Google Analytics, U.S. data from May 2014 to May 2015↩︎</p></li>
<li id="fn2"><p>Google/Ipsos Connect, travel playbook omnibus, n=1,063, among U.S. travelers 18+ who use a smartphone and for whom the statement is applicable, Apr.&nbsp;2016.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>behavioral data</category>
  <guid>https://gregordimi.com/posts/bahavioral-data-intro/</guid>
  <pubDate>Thu, 04 Aug 2016 00:00:00 GMT</pubDate>
</item>
</channel>
</rss>
