<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/average-spend-activities-and-length-of-visit-in-the-nz-international-visitor-survey-by-ellis2013nz/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://ellisp.github.io/blog/2018/02/03/ivs"> Peter's stats stuff - R</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<h2>A puzzle</h2>
<p>In my <a rel="nofollow" href="http://ellisp.github.io/blog/2018/01/23/recruiting" target="_blank">last blog post</a>, I gave a hypothetical test exercise for candidates in a recruitment process, involving the International Visitor Survey (IVS) from the Ministry of Business, Innovation and Employment (MBIE). I once managed the team responsible for that survey and other sector data, so I was familiar with it, knew the exercise made sense, and knew the microdata are publicly available (albeit not documented as well as anyone would like – a known issue, it’s never possible to do everything). In <a rel="nofollow" href="https://www.facebook.com/peterstats/" target="_blank">follow-up discussion on Facebook</a> I said I’d never give an exercise that I couldn’t complete myself in a reasonable amount of time, so I thought a good follow-up post would be to show the sort of thing I’d expected from candidates.</p>
<p><a rel="nofollow" href="https://en.wikipedia.org/wiki/Queenstown,_New_Zealand" target="_blank"><img align="right" title="Queenstown is a great centre for tramping and other outdoors stuff" src="https://i0.wp.com/ellisp.github.io/img/Queenstown_from_Bobs_Peak.jpg?w=300" data-recalc-dims="1"></a></p>
<p>Well, this particular exercise failed to pass that test because it took me too long to do it myself. Partly because there were too many things mentioned (comparing visitors to Queenstown to others; spend; activities; length of stay; origin); and partly for the more interesting reason that there was a real fish-hook hidden in the data. Rather than boringly talk about how the recruitment test needs to be cut down a bit, this blog is about that fish-hook, which involves the perils of analysis of data where concepts have a one-to-many relationship, which in the right circumstances can make it look like:</p>
<blockquote>
<p>Everyone is above average here!</p>
</blockquote>
<p>Before I dive into it, here’s the problem at a high level. One of the things that needed to be done to answer the questions posed in exercise was the average spend of tourists who stayed overnight in Queenstown (a town in New Zealand’s south island, heavily touristed, ideal for outdoors activity, extremely beautiful – see picture above) compared to those who didn’t. The obvious chart to address this is this one:</p>
<p><img width="100%" src="http://ellisp.github.io/img/0115-qt-spend.svg"></p>
<p>MBIE processes and publishes the IVS data on a quarterly basis and there’s quite a seasonal effect even in average spend, so the thicker, darker lines are seasonally adjusted whereas the thin lines are the original.</p>
<p>So far so good; the graph shows nicely that people visiting Queenstown, many of them skiers, and nearly all of them paying relatively high accommodation and hospitality prices, spend more money on their trip to New Zealand than do other visitors. The hitch came in when I tried running the same code with other destinations, such as Christchurch, Dunedin, Auckland, Wellington, Gisborne, Totaranui, Golden Bay… nearly everywhere I tried, the graphic looked similar to this. Tourists who stay at least one night in region X spend more than do tourists who don’t, for a very broad collection of X.</p>
<p>Let’s see how that can be the case.</p>
<h2>Loading up the IVS</h2>
<p>First, let’s set up our R session and download the IVS data. The data comes in a zip file from the MBIE website, which contains 26 different CSV files. Each of these files is actually a copy of a view in MBIE’s own database, so by doing analysis with these files we should be able to replicate exactly the approach used in MBIE itself. We won’t need all 26 views, but it’s just as easy to load them all in at once. I considered putting them into a database, to even closer replicate the in-MBIE experience, but the total size of the data is only about 230MB (when unzipped) and it doesn’t take long to load them all into memory, so I went with the simpler approach of keeping everything in R.</p>
<figure>
<pre><code data-lang="r"><span>library</span><span>(</span><span>tidyverse</span><span>)</span><span>
</span><span>library</span><span>(</span><span>data.table</span><span>)</span><span>
</span><span>library</span><span>(</span><span>scales</span><span>)</span><span>
</span><span>library</span><span>(</span><span>stringr</span><span>)</span><span>
</span><span>library</span><span>(</span><span>forcats</span><span>)</span><span>
</span><span>library</span><span>(</span><span>ggseas</span><span>)</span><span>
</span><span>library</span><span>(</span><span>testthat</span><span>)</span><span>
</span><span>#========Download and import data===============
# download survey data from the MBIE (Ministry of Business, Innovation and Employment) website
</span><span>download.file</span><span>(</span><span>&quot;http://www.mbie.govt.nz/info-services/sectors-industries/tourism/tourism-research-data/ivs/documents-image-library/vw_IVS.zip&quot;</span><span>,</span><span>
</span><span>mode</span><span> </span><span>=</span><span> </span><span>&quot;wb&quot;</span><span>,</span><span> </span><span>destfile</span><span> </span><span>=</span><span> </span><span>&quot;vw_IVS.zip&quot;</span><span>)</span><span>
</span><span>unzip</span><span>(</span><span>&quot;vw_IVS.zip&quot;</span><span>)</span><span>
</span><span># list of CSV files, each one of which is a copy of a view in the MBIE database:
</span><span>files</span><span> </span><span>&lt;-</span><span> </span><span>list.files</span><span>(</span><span>&quot;IVS&quot;</span><span>)</span><span>
</span><span># import each CSV file as a data.table/data.frame object in RAM with the name of the view
</span><span>for</span><span>(</span><span>i</span><span> </span><span>in</span><span> </span><span>1</span><span>:</span><span>length</span><span>(</span><span>files</span><span>)){</span><span>
</span><span>print</span><span>(</span><span>paste</span><span>(</span><span>&quot;Importing&quot;</span><span>,</span><span> </span><span>files</span><span>[</span><span>i</span><span>]))</span><span>
</span><span>tmp</span><span> </span><span>&lt;-</span><span> </span><span>fread</span><span>(</span><span>paste0</span><span>(</span><span>&quot;IVS/&quot;</span><span>,</span><span> </span><span>files</span><span>[</span><span>i</span><span>]))</span><span>
</span><span># knock off the &quot;.csv&quot; at the end of each file name, for the name of the data frane in R:
</span><span> </span><span>dfname</span><span> </span><span>&lt;-</span><span> </span><span>str_sub</span><span>(</span><span>files</span><span>[</span><span>i</span><span>],</span><span> </span><span>end</span><span> </span><span>=</span><span> </span><span>-5</span><span>)</span><span>
</span><span>assign</span><span>(</span><span>dfname</span><span>,</span><span> </span><span>tmp</span><span>)</span><span>
</span><span>}</span></code></pre>
</figure>
<p>The most important table is the one called <code>vw_IVSSurveyMainHeader</code>. This has all the survey responses (and artificial variables, like sampling cluster and population weight) that make sense to store on a table of one row per respondent. So observations for which there is only one of for each person – like country of residence next year, purpose of visit, total spend in New Zealand, age and sex – are all stored here. A lot of analysis can be done with just this table. For example, here’s a chart of quarterly spend and visitor numbers by purpose of visit:</p>
<p><img width="100%" src="http://ellisp.github.io/img/0115-total-spend.svg"></p>
<p>The seasonal adjustment here (the thick line) is done on the fly in the ggplot2 pipeline, using X13-SEATS-ARIMA via the <code>seasonal</code> and <code>ggseas</code> R packages, with the line beginning <code>stat_seas</code> in the code below. In this graphic, notice the way that numbers of holiday makers and (even more so) their spend per visitor took off in the boom beginning around 2014. The numbers of visitors actually come from the arrival/departure cards and get reflected in the IVS via its weighting, so there should be no likelihood of error in the right hand facet. I don’t know what’s behind the jump in “VFR” (visiting friends and relatives) visitor numbers in the early 2000s.</p>
<p>Code for that chart:</p>
<figure>
<pre><code data-lang="r"><span>#=============Familiarisation============
# First analysis is just to get a feel for the data; not used in the final report
</span><span>head</span><span>(</span><span>vw_IVSSurveyMainHeader</span><span>)</span><span>
</span><span># total spend by purpose of visit
# Note that &quot;WeightedSpend&quot; just means outlier-treated; you need to
# use PopulationWeight to get the actual survey weights
</span><span>spend_pov</span><span> </span><span>&lt;-</span><span> </span><span>vw_IVSSurveyMainHeader</span><span> </span><span>%>%</span><span>
</span><span>group_by</span><span>(</span><span>Qtr</span><span>,</span><span> </span><span>POV</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>summarise</span><span>(</span><span>total_spend</span><span> </span><span>=</span><span> </span><span>sum</span><span>(</span><span>WeightedSpend</span><span> </span><span>*</span><span> </span><span>PopulationWeight</span><span>),</span><span>
</span><span>visitors</span><span> </span><span>=</span><span> </span><span>sum</span><span>(</span><span>PopulationWeight</span><span>),</span><span>
</span><span>sample_size</span><span> </span><span>=</span><span> </span><span>n</span><span>())</span><span>
</span><span># graphic </span><span>spend_pov</span><span> </span><span>%>%</span><span>
</span><span># convert the &quot;1997 1&quot; format into a number:
</span><span> </span><span>mutate</span><span>(</span><span>qtr</span><span> </span><span>=</span><span> </span><span>as.numeric</span><span>(</span><span>str_sub</span><span>(</span><span>Qtr</span><span>,</span><span> </span><span>start</span><span> </span><span>=</span><span> </span><span>-1</span><span>)),</span><span>
</span><span>yr</span><span> </span><span>=</span><span> </span><span>as.numeric</span><span>(</span><span>str_sub</span><span>(</span><span>Qtr</span><span>,</span><span> </span><span>end</span><span> </span><span>=</span><span> </span><span>4</span><span>)),</span><span>
</span><span>yr_qtr</span><span> </span><span>=</span><span> </span><span>yr</span><span> </span><span>+</span><span> </span><span>(</span><span>qtr</span><span> </span><span>-</span><span> </span><span>0.5</span><span>)</span><span> </span><span>/</span><span> </span><span>4</span><span>)</span><span> </span><span>%>%</span><span>
</span><span># reshape:
</span><span> </span><span>ungroup</span><span>()</span><span> </span><span>%>%</span><span>
</span><span>select</span><span>(</span><span>yr_qtr</span><span>,</span><span> </span><span>POV</span><span>,</span><span> </span><span>total_spend</span><span>,</span><span> </span><span>visitors</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>gather</span><span>(</span><span>variable</span><span>,</span><span> </span><span>value</span><span>,</span><span> </span><span>-</span><span>yr_qtr</span><span>,</span><span> </span><span>-</span><span>POV</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>POV</span><span> </span><span>=</span><span> </span><span>fct_reorder</span><span>(</span><span>POV</span><span>,</span><span> </span><span>-</span><span>value</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>ggplot</span><span>(</span><span>aes</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>yr_qtr</span><span>,</span><span> </span><span>y</span><span> </span><span>=</span><span> </span><span>value</span><span>,</span><span> </span><span>colour</span><span> </span><span>=</span><span> </span><span>POV</span><span>))</span><span> </span><span>+</span><span>
</span><span>facet_wrap</span><span>(</span><span>~</span><span>variable</span><span>,</span><span> </span><span>scale</span><span> </span><span>=</span><span> </span><span>&quot;free_y&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>geom_line</span><span>(</span><span>alpha</span><span> </span><span>=</span><span> </span><span>0.3</span><span>)</span><span> </span><span>+</span><span>
</span><span>stat_seas</span><span>(</span><span>start</span><span> </span><span>=</span><span> </span><span>c</span><span>(</span><span>1997</span><span>,</span><span> </span><span>1</span><span>),</span><span> </span><span>size</span><span> </span><span>=</span><span> </span><span>1.2</span><span>)</span><span> </span><span>+</span><span>
</span><span>scale_y_continuous</span><span>(</span><span>&quot;&quot;</span><span>,</span><span> </span><span>label</span><span> </span><span>=</span><span> </span><span>comma</span><span>)</span><span> </span><span>+</span><span>
</span><span>ggtitle</span><span>(</span><span>&quot;Weighted spend and visitor numbers, visits to New Zealand&quot;</span><span>,</span><span>
</span><span>&quot;Highly seasonal quarterly data&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>labs</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>&quot;&quot;</span><span>,</span><span> </span><span>colour</span><span> </span><span>=</span><span> </span><span>&quot;Purpose\nof Visit&quot;</span><span>,</span><span>
</span><span>caption</span><span> </span><span>=</span><span> </span><span>&quot;Source: MBIE International Visitor Survey&quot;</span><span>)</span></code></pre>
</figure>
<h2>Checking out spend and activities for visitors to one area</h2>
<p>Next step is to identify which tourists included an overnight stay in Queenstown in their visit, and compare their average spend, activities and length of stay to those who didn’t. In addition to the plot that I used near the beginning of the post, this gets us this one:</p>
<p><img width="100%" src="http://ellisp.github.io/img/0115-qt-activities.svg"></p>
<p>We can see that like spend, the Queenstown visitors stay longer in New Zealand, and do more activities while in New Zealand, than do visitors who did not overnight in Queenstown. Note the very obvious break in the “activities” series in 2013. This came with a major redevelopment of the survey, moving most of the data collection on line and rationalising the questionnaire for shorter interviews. While spend and length of stay are pretty much comparable (and in fact, great lengths were gone to to backcast the old spend data onto the same basis as the new survey), this wasn’t possible with all the secondary characteristics such as activities, transport types, etc. This break in series is responsible for other quirks too, such as the possibility of respondents reporting no locations overnighted in, which only appears in 2013; another artefact of how the old questionnaire and data model was translated into the new in the best way that could be managed.</p>
<p>A few points to note in the analysis below, creating these charts:</p>
<ul>
<li>Visitors are asked (from 2013 onwards) what activities they did in their <em>whole New Zealand trip</em>, not broken down by region. The historical data has been put in the same data model, but the change in mode and questionnaire still leads to a series break. As visitors have multiple activities per trip to New Zealand, the activities-respondents combinations are stored in their own long, thin <code>vw_IVSActivities</code> table.</li>
<li>Visitors can stay overnight in zero or more locations (some people fly in and out on the same day), so similarly the locations-respondents combinations are stored in their own table, <code>vw_IVSItineraryPlaces</code>. There are 514 point locations respondents are allowed to choose from (using an on-screen map) as overnighting locations.</li>
<li>I defined my own palette, with colours named “Visited Queenstown”, “Did not visit Queenstown” etc, to use with <code>scale_colour_manual()</code> in order to ensure colours were used consistently in all charts in the analysis.</li>
<li>Like activities, spend and length of stay are only analysed here on the basis of overall spend and length of stay in <em>New Zealand</em>, not just the Queenstown leg. Spend data is not available in this survey for Queenstown (other official statistics, based on electronic card data, can give spend data to that level, but not allocated to individual respondents); length of stay in all of New Zealand was part of the original research question.</li>
<li>I separated the average spend chart from the faceted plot showing activities and length of stay, partly so spend could have a $ sign in its scale.</li>
</ul>
<figure>
<pre><code data-lang="r"><span>#================Activities=================
</span><span>head</span><span>(</span><span>vw_IVSActivities</span><span>)</span><span>
</span><span># hmm, an interesting set of &quot;Activities&quot; but we have no way of identifying which are &quot;good&quot; or not
# so we will just count them per person/visit
</span><span>
</span><span># number of activities per person
</span><span>act_pp</span><span> </span><span>&lt;-</span><span> </span><span>vw_IVSActivities</span><span> </span><span>%>%</span><span>
</span><span>group_by</span><span>(</span><span>SurveyResponseID</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>summarise</span><span>(</span><span>number_activities</span><span> </span><span>=</span><span> </span><span>n</span><span>())</span><span>
</span><span>#================Queenstown=====================
</span><span>head</span><span>(</span><span>vw_IVSItineraryPlaces</span><span>)</span><span>
</span><span># 514 distinct places listed:
</span><span>sort</span><span>(</span><span>unique</span><span>(</span><span>vw_IVSItineraryPlaces</span><span>$</span><span>WhereStayed</span><span>))</span><span>
</span><span>places_visited</span><span> </span><span>&lt;-</span><span> </span><span>vw_IVSItineraryPlaces</span><span> </span><span>%>%</span><span>
</span><span>group_by</span><span>(</span><span>SurveyResponseID</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>summarise</span><span>(</span><span>number_places_visited</span><span> </span><span>=</span><span> </span><span>length</span><span>(</span><span>unique</span><span>(</span><span>WhereStayed</span><span>)),</span><span>
</span><span>visited_queenstown</span><span> </span><span>=</span><span> </span><span>ifelse</span><span>(</span><span>&quot;Queenstown&quot;</span><span> </span><span>%in%</span><span> </span><span>unique</span><span>(</span><span>WhereStayed</span><span>),</span><span> </span><span>&quot;Visited Queenstown&quot;</span><span>,</span><span> </span><span>&quot;Did not visit Queenstown&quot;</span><span>))</span><span>
</span><span>qt_visitors</span><span> </span><span>&lt;-</span><span> </span><span>places_visited</span><span> </span><span>%>%</span><span>
</span><span>right_join</span><span>(</span><span>vw_IVSSurveyMainHeader</span><span>,</span><span> </span><span>by</span><span> </span><span>=</span><span> </span><span>&quot;SurveyResponseID&quot;</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>qtr</span><span> </span><span>=</span><span> </span><span>as.numeric</span><span>(</span><span>str_sub</span><span>(</span><span>Qtr</span><span>,</span><span> </span><span>start</span><span> </span><span>=</span><span> </span><span>-1</span><span>)),</span><span>
</span><span>yr</span><span> </span><span>=</span><span> </span><span>as.numeric</span><span>(</span><span>str_sub</span><span>(</span><span>Qtr</span><span>,</span><span> </span><span>end</span><span> </span><span>=</span><span> </span><span>4</span><span>)),</span><span>
</span><span>yr_qtr</span><span> </span><span>=</span><span> </span><span>yr</span><span> </span><span>+</span><span> </span><span>(</span><span>qtr</span><span> </span><span>-</span><span> </span><span>0.5</span><span>)</span><span> </span><span>/</span><span> </span><span>4</span><span>,</span><span>
</span><span>visited_queenstown</span><span> </span><span>=</span><span> </span><span>ifelse</span><span>(</span><span>is.na</span><span>(</span><span>visited_queenstown</span><span>),</span><span> </span><span>&quot;Did not visit *anywhere*&quot;</span><span>,</span><span> </span><span>visited_queenstown</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>left_join</span><span>(</span><span>act_pp</span><span>,</span><span> </span><span>by</span><span> </span><span>=</span><span> </span><span>&quot;SurveyResponseID&quot;</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>group_by</span><span>(</span><span>visited_queenstown</span><span>,</span><span> </span><span>yr_qtr</span><span>)</span><span>
</span><span>expect_equal</span><span>(</span><span>nrow</span><span>(</span><span>qt_visitors</span><span>),</span><span> </span><span>nrow</span><span>(</span><span>vw_IVSSurveyMainHeader</span><span>))</span><span>
</span><span># Two variables look to be about length of stay; but NoDaysInNZ has 120,000+ NA values so we will use the other
# option which has only 196
</span><span>summary</span><span>(</span><span>vw_IVSSurveyMainHeader</span><span>[</span><span> </span><span>,</span><span> </span><span>c</span><span>(</span><span>&quot;NoDaysInNZ&quot;</span><span>,</span><span> </span><span>&quot;LengthOfStay&quot;</span><span>)])</span><span>
</span><span>qt_visitors_sum</span><span> </span><span>&lt;-</span><span> </span><span>qt_visitors</span><span> </span><span>%>%</span><span>
</span><span>summarise</span><span>(</span><span>total_spend</span><span> </span><span>=</span><span> </span><span>sum</span><span>(</span><span>WeightedSpend</span><span> </span><span>*</span><span> </span><span>PopulationWeight</span><span>),</span><span>
</span><span>total_days</span><span> </span><span>=</span><span> </span><span>sum</span><span>(</span><span>LengthOfStay</span><span> </span><span>*</span><span> </span><span>PopulationWeight</span><span>,</span><span> </span><span>na.rm</span><span> </span><span>=</span><span> </span><span>TRUE</span><span>),</span><span>
</span><span>total_activities</span><span> </span><span>=</span><span> </span><span>sum</span><span>(</span><span>number_activities</span><span> </span><span>*</span><span> </span><span>PopulationWeight</span><span>,</span><span> </span><span>na.rm</span><span> </span><span>=</span><span> </span><span>TRUE</span><span>),</span><span>
</span><span>visitors</span><span> </span><span>=</span><span> </span><span>sum</span><span>(</span><span>PopulationWeight</span><span>),</span><span>
</span><span>spend_per_visitor</span><span> </span><span>=</span><span> </span><span>total_spend</span><span> </span><span>/</span><span> </span><span>visitors</span><span>,</span><span>
</span><span>days_per_visitor</span><span> </span><span>=</span><span> </span><span>total_days</span><span> </span><span>/</span><span> </span><span>visitors</span><span>,</span><span>
</span><span>activities_per_visitor</span><span> </span><span>=</span><span> </span><span>total_activities</span><span> </span><span>/</span><span> </span><span>visitors</span><span>,</span><span>
</span><span>sample_size</span><span> </span><span>=</span><span> </span><span>n</span><span>())</span><span> </span><span>%>%</span><span>
</span><span>ungroup</span><span>()</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>visited_queenstown</span><span> </span><span>=</span><span> </span><span>fct_reorder</span><span>(</span><span>visited_queenstown</span><span>,</span><span> </span><span>total_spend</span><span>))</span><span>
</span><span>palette</span><span> </span><span>&lt;-</span><span> </span><span>c</span><span>(</span><span>&quot;Visited Queenstown&quot;</span><span> </span><span>=</span><span> </span><span>&quot;red&quot;</span><span>,</span><span> </span><span>&quot;Did not visit Queenstown&quot;</span><span> </span><span>=</span><span> </span><span>&quot;blue&quot;</span><span>,</span><span> </span><span>&quot;Did not visit *anywhere*&quot;</span><span> </span><span>=</span><span> </span><span>&quot;grey&quot;</span><span>)</span><span>
</span><span># do they spend more per visit?
</span><span>qt_visitors_sum</span><span> </span><span>%>%</span><span>
</span><span>ggplot</span><span>(</span><span>aes</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>yr_qtr</span><span>,</span><span> </span><span>y</span><span> </span><span>=</span><span> </span><span>spend_per_visitor</span><span>,</span><span> </span><span>colour</span><span> </span><span>=</span><span> </span><span>visited_queenstown</span><span>))</span><span> </span><span>+</span><span>
</span><span>geom_line</span><span>(</span><span>alpha</span><span> </span><span>=</span><span> </span><span>0.15</span><span>)</span><span> </span><span>+</span><span>
</span><span>stat_stl</span><span>(</span><span>s.window</span><span> </span><span>=</span><span> </span><span>7</span><span>,</span><span> </span><span>size</span><span> </span><span>=</span><span> </span><span>1.2</span><span>)</span><span> </span><span>+</span><span>
</span><span>theme</span><span>(</span><span>legend.position</span><span> </span><span>=</span><span> </span><span>&quot;right&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>scale_colour_manual</span><span>(</span><span>&quot;&quot;</span><span>,</span><span> </span><span>values</span><span> </span><span>=</span><span> </span><span>palette</span><span>)</span><span> </span><span>+</span><span>
</span><span>scale_y_continuous</span><span>(</span><span>&quot;Spend per visitor\n(seasonally adjusted)&quot;</span><span>,</span><span> </span><span>label</span><span> </span><span>=</span><span> </span><span>dollar</span><span>)</span><span> </span><span>+</span><span>
</span><span>labs</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>&quot;&quot;</span><span>,</span><span> </span><span>caption</span><span> </span><span>=</span><span> </span><span>&quot;Source: MBIE International Visitor Survey&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>ggtitle</span><span>(</span><span>&quot;Total spend while in New Zealand&quot;</span><span>,</span><span> </span><span>&quot;Comparing visitors who went to Queenstown with those who did not&quot;</span><span>)</span><span>
</span><span># do they stay more days and do more activities?
</span><span>qt_visitors_sum</span><span> </span><span>%>%</span><span>
</span><span>select</span><span>(</span><span>visited_queenstown</span><span>,</span><span> </span><span>yr_qtr</span><span>,</span><span> </span><span>days_per_visitor</span><span>,</span><span> </span><span>activities_per_visitor</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>gather</span><span>(</span><span>variable</span><span>,</span><span> </span><span>value</span><span>,</span><span> </span><span>-</span><span>visited_queenstown</span><span>,</span><span> </span><span>-</span><span>yr_qtr</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>ggplot</span><span>(</span><span>aes</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>yr_qtr</span><span>,</span><span> </span><span>y</span><span> </span><span>=</span><span> </span><span>value</span><span>,</span><span> </span><span>colour</span><span> </span><span>=</span><span> </span><span>visited_queenstown</span><span>))</span><span> </span><span>+</span><span>
</span><span>facet_wrap</span><span>(</span><span>~</span><span>variable</span><span>,</span><span> </span><span>scales</span><span> </span><span>=</span><span> </span><span>&quot;free_y&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>geom_line</span><span>(</span><span>alpha</span><span> </span><span>=</span><span> </span><span>0.15</span><span>)</span><span> </span><span>+</span><span>
</span><span>stat_stl</span><span>(</span><span>s.window</span><span> </span><span>=</span><span> </span><span>7</span><span>,</span><span> </span><span>size</span><span> </span><span>=</span><span> </span><span>1.2</span><span>)</span><span> </span><span>+</span><span>
</span><span>scale_colour_manual</span><span>(</span><span>&quot;&quot;</span><span>,</span><span> </span><span>values</span><span> </span><span>=</span><span> </span><span>palette</span><span>)</span><span> </span><span>+</span><span>
</span><span>scale_y_continuous</span><span>(</span><span>&quot;Value\n(seasonally adjusted)&quot;</span><span>,</span><span> </span><span>label</span><span> </span><span>=</span><span> </span><span>comma</span><span>)</span><span> </span><span>+</span><span>
</span><span>labs</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>&quot;&quot;</span><span>,</span><span> </span><span>caption</span><span> </span><span>=</span><span> </span><span>&quot;Source: MBIE International Visitor Survey&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>ggtitle</span><span>(</span><span>&quot;Activities and length of stay while in New Zealand&quot;</span><span>,</span><span> </span><span>&quot;Comparing visitors who went to Queenstown with those who did not&quot;</span><span>)</span></code></pre>
</figure>
<h2>Let’s look at all locations at once…</h2>
<p>Now is where it gets puzzling. Running the code above but substituting nearly any other location for Queenstown gets a similar pattern – higher average spend, length of stay, and number of activities for the people who visited that location than those who didn’t. Let’s go straight to a chart of the top 150 locations – not all of them labelled – showing the average spend of people who overnighted in that location:</p>
<p><img width="100%" src="http://ellisp.github.io/img/0115-all-locations.svg"></p>
<p>We can see that a big majority of places have above-average spend, shown by the vertical blue line at about $3,200. The same applies to the other value variables we’ve considered (number of activities, and length of stay).</p>
<p>The code that produces this is shown below. An important thing to note here is that many individuals will be counted against multiple locations. There’s nothing wrong with this, it’s by design, but it’s important to note! Individuals who stayed overnight at more locations get counted more than those who stayed at fewer locations – something that gives us the clue for how all locations can be “above average”.</p>
<figure>
<pre><code data-lang="r"><span>#===============detective work into how all locations seem to have higher spenders on average=========================
</span><span>
</span><span># each distinct place visited at least once by each person:
</span><span>ip</span><span> </span><span>&lt;-</span><span> </span><span>vw_IVSItineraryPlaces</span><span> </span><span>%>%</span><span>
</span><span>select</span><span>(</span><span>SurveyResponseID</span><span>,</span><span> </span><span>WhereStayed</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>distinct</span><span>()</span><span>
</span><span># total and average spend for each location, 2014 onwards:
</span><span>all_locs</span><span> </span><span>&lt;-</span><span> </span><span>vw_IVSSurveyMainHeader</span><span> </span><span>%>%</span><span>
</span><span>filter</span><span>(</span><span>Year</span><span> </span><span>>=</span><span> </span><span>2014</span><span>)</span><span> </span><span>%>%</span><span> </span><span>left_join</span><span>(</span><span>ip</span><span>,</span><span> </span><span>by</span><span> </span><span>=</span><span> </span><span>&quot;SurveyResponseID&quot;</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>WhereStayed</span><span> </span><span>=</span><span> </span><span>ifelse</span><span>(</span><span>is.na</span><span>(</span><span>WhereStayed</span><span>),</span><span> </span><span>&quot;Did not stay overnight at any location&quot;</span><span>,</span><span> </span><span>WhereStayed</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>group_by</span><span>(</span><span>WhereStayed</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>summarise</span><span>(</span><span>total_spend</span><span> </span><span>=</span><span> </span><span>sum</span><span>(</span><span>WeightedSpend</span><span> </span><span>*</span><span> </span><span>PopulationWeight</span><span>,</span><span> </span><span>na.rm</span><span> </span><span>=</span><span> </span><span>TRUE</span><span>),</span><span>
</span><span>visitors</span><span> </span><span>=</span><span> </span><span>sum</span><span>(</span><span>PopulationWeight</span><span>,</span><span> </span><span>na.rm</span><span> </span><span>=</span><span> </span><span>TRUE</span><span>),</span><span>
</span><span>mean_spend</span><span> </span><span>=</span><span> </span><span>total_spend</span><span> </span><span>/</span><span> </span><span>visitors</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>filter</span><span>(</span><span>visitors</span><span> </span><span>></span><span> </span><span>0</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>arrange</span><span>(</span><span>desc</span><span>(</span><span>mean_spend</span><span>))</span><span>
</span><span># overall average for comparison
</span><span>overall_mean</span><span> </span><span>&lt;-</span><span> </span><span>vw_IVSSurveyMainHeader</span><span> </span><span>%>%</span><span>
</span><span>filter</span><span>(</span><span>Year</span><span> </span><span>>=</span><span> </span><span>2014</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>summarise</span><span>(</span><span>mean_spend</span><span> </span><span>=</span><span> </span><span>sum</span><span>(</span><span>WeightedSpend</span><span> </span><span>*</span><span> </span><span>PopulationWeight</span><span>)</span><span> </span><span>/</span><span> </span><span>sum</span><span>(</span><span>PopulationWeight</span><span>))</span><span>
</span><span># graphic of just the 150 biggest
</span><span>all_locs</span><span> </span><span>%>%</span><span>
</span><span>filter</span><span>(</span><span>rank</span><span>(</span><span>-</span><span>visitors</span><span>)</span><span> </span><span>&lt;=</span><span> </span><span>150</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>label</span><span> </span><span>=</span><span> </span><span>ifelse</span><span>(</span><span>rank</span><span>(</span><span>-</span><span>visitors</span><span>)</span><span> </span><span></span><span> </span><span>20</span><span>,</span><span> </span><span>WhereStayed</span><span>,</span><span> </span><span>&quot;&quot;</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>WhereStayed</span><span> </span><span>=</span><span> </span><span>fct_reorder</span><span>(</span><span>WhereStayed</span><span>,</span><span> </span><span>mean_spend</span><span>))</span><span> </span><span>%>%</span><span> </span><span>ggplot</span><span>(</span><span>aes</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>mean_spend</span><span>,</span><span> </span><span>y</span><span> </span><span>=</span><span> </span><span>WhereStayed</span><span>))</span><span> </span><span>+</span><span>
</span><span>geom_vline</span><span>(</span><span>xintercept</span><span> </span><span>=</span><span> </span><span>overall_mean</span><span>$</span><span>mean_spend</span><span>,</span><span> </span><span>colour</span><span> </span><span>=</span><span> </span><span>&quot;steelblue&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>geom_point</span><span>(</span><span>aes</span><span>(</span><span>size</span><span> </span><span>=</span><span> </span><span>visitors</span><span>))</span><span> </span><span>+</span><span>
</span><span>geom_text</span><span>(</span><span>aes</span><span>(</span><span>label</span><span> </span><span>=</span><span> </span><span>label</span><span>),</span><span> </span><span>hjust</span><span> </span><span>=</span><span> </span><span>0</span><span>,</span><span> </span><span>nudge_x</span><span> </span><span>=</span><span> </span><span>100</span><span>,</span><span> </span><span>size</span><span> </span><span>=</span><span> </span><span>2</span><span>)</span><span> </span><span>+</span><span>
</span><span>scale_x_continuous</span><span>(</span><span>&quot;Mean spend per visit from 2014 to 2017&quot;</span><span>,</span><span> </span><span>label</span><span> </span><span>=</span><span> </span><span>dollar</span><span>)</span><span> </span><span>+</span><span>
</span><span>scale_size_area</span><span>(</span><span>&quot;Number of visitors\nsince 2014&quot;</span><span>,</span><span> </span><span>label</span><span> </span><span>=</span><span> </span><span>comma</span><span>)</span><span> </span><span>+</span><span>
</span><span>labs</span><span>(</span><span>caption</span><span> </span><span>=</span><span> </span><span>&quot;Source: MBIE International Visitor Survey&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>ggtitle</span><span>(</span><span>&quot;Mean spend of visitors to the 150 most visited locations&quot;</span><span>,</span><span>
</span><span>&quot;Only the top 20 locations are labelled&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>theme</span><span>(</span><span>axis.text.y</span><span> </span><span>=</span><span> </span><span>element_blank</span><span>(),</span><span>
</span><span>legend.position</span><span> </span><span>=</span><span> </span><span>&quot;right&quot;</span><span>)</span></code></pre>
</figure>
<h2>Relationship between visits and spend</h2>
<p>So the mystery becomes clear once we think through the issue:</p>
<blockquote>
<p>“if individuals who overnight at more locations get counted more times, is there any relationship between number of locations visited and individuals’ spend?”</p>
</blockquote>
<p>… and of course there is such a relationship. Here it is at the individual level:</p>
<p><img src="https://i0.wp.com/ellisp.github.io/img/0115-individuals.png?w=100%25" data-recalc-dims="1"></p>
<p>Generally speaking, the more locations visited overnight (at least up to about 25), the higher individuals’ total spend in New Zealand. In fact, this makes perfect sense once you think about it.</p>
<p>[BTW, the image above is in PNG format rather than the SVG I usually use, to save space. As there is a semi-transparent dot for every respondent of the survey since 2014, that’s 30,000+ points for the SVG to hold information on and individually draw. It’s quicker to render in your browser and smaller file size to blur it into a PNG, which only needs to know which colour to draw each pixel, not the instructions for drawing the whole thing from scratch as needed by an SVG.]</p>
<p>The trend is even more obvious when we aggregate up the data to show mean spend for each value of “locations visited”:</p>
<p><img width="100%" src="http://ellisp.github.io/img/0115-grouped.svg"></p>
<p>This chart also reveals the interesting fact that visitors who report (and remember, it’s only a survey) <em>zero</em> locations visited overnight actually have slightly more than average spend; it’s only when we get to the “one location reported” individuals that the pattern becomes strong.</p>
<p>So, the very people who stayed at many locations and hence contribute to the mean spend, length of stay and activities of each location’s visitors, are of course the visitors who spend more money, time and activity while they are in New Zealand. The apparent conundrum of all locations having “better than average” visitors disappears. Nothing to see here, just a warning to look carefully into claims that any particular group is above average, when individuals get to contribute to multiple groups.</p>
<p>Here’s the code for the final two charts:</p>
<figure>
<pre><code data-lang="r"><span>vw_IVSSurveyMainHeader</span><span> </span><span>%>%</span><span>
</span><span>filter</span><span>(</span><span>Year</span><span> </span><span>>=</span><span> </span><span>2014</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>left_join</span><span>(</span><span>places_visited</span><span>,</span><span> </span><span>by</span><span> </span><span>=</span><span> </span><span>&quot;SurveyResponseID&quot;</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>number_places_overnighted</span><span> </span><span>=</span><span> </span><span>ifelse</span><span>(</span><span>is.na</span><span>(</span><span>number_places_visited</span><span>),</span><span> </span><span>0</span><span>,</span><span> </span><span>number_places_visited</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>ggplot</span><span>(</span><span>aes</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>number_places_overnighted</span><span>,</span><span> </span><span>y</span><span> </span><span>=</span><span> </span><span>WeightedSpend</span><span>,</span><span> </span><span>size</span><span> </span><span>=</span><span> </span><span>PopulationWeight</span><span>))</span><span> </span><span>+</span><span>
</span><span>geom_point</span><span>(</span><span>alpha</span><span> </span><span>=</span><span> </span><span>0.1</span><span>)</span><span> </span><span>+</span><span>
</span><span>geom_hline</span><span>(</span><span>yintercept</span><span> </span><span>=</span><span> </span><span>overall_mean</span><span>$</span><span>mean_spend</span><span>,</span><span> </span><span>colour</span><span> </span><span>=</span><span> </span><span>&quot;steelblue&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>geom_smooth</span><span>(</span><span>colour</span><span> </span><span>=</span><span> </span><span>&quot;orange&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>annotate</span><span>(</span><span>&quot;text&quot;</span><span>,</span><span> </span><span>x</span><span> </span><span>=</span><span> </span><span>70</span><span>,</span><span> </span><span>y</span><span> </span><span>=</span><span> </span><span>overall_mean</span><span>$</span><span>mean_spend</span><span> </span><span>-</span><span> </span><span>1000</span><span>,</span><span> </span><span>label</span><span> </span><span>=</span><span> </span><span>&quot;Overall mean&quot;</span><span>,</span><span> </span><span>colour</span><span> </span><span>=</span><span> </span><span>&quot;steelblue&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>scale_y_sqrt</span><span>(</span><span>&quot;Spend in New Zealand\n(square root transformed scale)&quot;</span><span>,</span><span>
</span><span>label</span><span> </span><span>=</span><span> </span><span>dollar</span><span>,</span><span> </span><span>breaks</span><span> </span><span>=</span><span> </span><span>c</span><span>(</span><span>1000</span><span>,</span><span> </span><span>10000</span><span>,</span><span> </span><span>25000</span><span>,</span><span> </span><span>50000</span><span>,</span><span> </span><span>100000</span><span>,</span><span> </span><span>200000</span><span>))</span><span> </span><span>+</span><span>
</span><span>labs</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>&quot;Number of places overnighted in\n&quot;</span><span>,</span><span>
</span><span>caption</span><span> </span><span>=</span><span> </span><span>&quot;Source: MBIE International Visitor Survey&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>theme</span><span>(</span><span>legend.position</span><span> </span><span>=</span><span> </span><span>&quot;none&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>ggtitle</span><span>(</span><span>&quot;Individuals' spend in New Zealand compared to places visited&quot;</span><span>,</span><span>
</span><span>&quot;Data from 2014 to 2017&quot;</span><span>)</span><span>
</span><span>vw_IVSSurveyMainHeader</span><span> </span><span>%>%</span><span>
</span><span>filter</span><span>(</span><span>Year</span><span> </span><span>>=</span><span> </span><span>2014</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>left_join</span><span>(</span><span>places_visited</span><span>,</span><span> </span><span>by</span><span> </span><span>=</span><span> </span><span>&quot;SurveyResponseID&quot;</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>number_places_overnighted</span><span> </span><span>=</span><span> </span><span>ifelse</span><span>(</span><span>is.na</span><span>(</span><span>number_places_visited</span><span>),</span><span> </span><span>0</span><span>,</span><span> </span><span>number_places_visited</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>group_by</span><span>(</span><span>number_places_overnighted</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>summarise</span><span>(</span><span>mean_spend</span><span> </span><span>=</span><span> </span><span>sum</span><span>(</span><span>WeightedSpend</span><span> </span><span>*</span><span> </span><span>PopulationWeight</span><span>)</span><span> </span><span>/</span><span> </span><span>sum</span><span>(</span><span>PopulationWeight</span><span>),</span><span>
</span><span>visitors</span><span> </span><span>=</span><span> </span><span>sum</span><span>(</span><span>PopulationWeight</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>arrange</span><span>(</span><span>number_places_overnighted</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>ggplot</span><span>(</span><span>aes</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>number_places_overnighted</span><span>,</span><span> </span><span>y</span><span> </span><span>=</span><span> </span><span>mean_spend</span><span>,</span><span> </span><span>size</span><span> </span><span>=</span><span> </span><span>visitors</span><span>))</span><span> </span><span>+</span><span>
</span><span>geom_hline</span><span>(</span><span>yintercept</span><span> </span><span>=</span><span> </span><span>overall_mean</span><span>$</span><span>mean_spend</span><span>,</span><span> </span><span>colour</span><span> </span><span>=</span><span> </span><span>&quot;steelblue&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>geom_point</span><span>()</span><span> </span><span>+</span><span>
</span><span>annotate</span><span>(</span><span>&quot;text&quot;</span><span>,</span><span> </span><span>x</span><span> </span><span>=</span><span> </span><span>70</span><span>,</span><span> </span><span>y</span><span> </span><span>=</span><span> </span><span>overall_mean</span><span>$</span><span>mean_spend</span><span> </span><span>-</span><span> </span><span>500</span><span>,</span><span> </span><span>label</span><span> </span><span>=</span><span> </span><span>&quot;Overall mean&quot;</span><span>,</span><span> </span><span>colour</span><span> </span><span>=</span><span> </span><span>&quot;steelblue&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>scale_y_continuous</span><span>(</span><span>&quot;Mean spend in New Zealand&quot;</span><span>,</span><span>
</span><span>label</span><span> </span><span>=</span><span> </span><span>dollar</span><span>)</span><span> </span><span>+</span><span>
</span><span>labs</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>&quot;Number of places overnighted in\n&quot;</span><span>,</span><span>
</span><span>caption</span><span> </span><span>=</span><span> </span><span>&quot;Source: MBIE International Visitor Survey&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>theme</span><span>(</span><span>legend.position</span><span> </span><span>=</span><span> </span><span>&quot;none&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>ggtitle</span><span>(</span><span>&quot;Spend in New Zealand compared to places visited&quot;</span><span>,</span><span>
</span><span>&quot;Data from 2014 to 2017&quot;</span><span>)</span></code></pre>
</figure>
<p>More than ever, my <a rel="nofollow" href="http://ellisp.github.io/about/" target="_blank">usual disclaimer</a> applies here – this analysis is my own, not related to employers past and present. If we’d done this analysis at work back when I was with the IVS team, it would have much more peer review and quality control than my humble blog does. If you spot anything, let me know in the comments section.</p>
<p>If you want to explore the full range New Zealand’s tourism data interactively rather than via code, a great starting point is the Shiny app to end all Shiny apps, the MBIE <a rel="nofollow" href="http://tourismdashboard.mbie.govt.nz/" target="_blank">Tourism Dashboard</a>.</p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://ellisp.github.io/blog/2018/02/03/ivs"> Peter's stats stuff - R</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/tIvYPkQhd1k" height="1"></a></div>