<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/how-to-raise-money-on-kickstarter-tutorial-with-eda-and-predictions/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://journeyofanalytics.wordpress.com/2018/02/03/raise-money-on-kickstarter/"> R – Journey of Analytics</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<div> In this tutorial, we will explore the characterisitcs of projects on Kickstarter and try to understand what separates the winners from the projects that failed to reach their funding goals.</div>
<div>( This post is mirrored from our main blog site <a rel="nofollow" href="http://blog.journeyofanalytics.com/" target="_blank">blog.journeyofanalytics.com</a> . The code can be downloaded or run “LIVE” from Kaggle using <a rel="nofollow" href="https://www.kaggle.com/anu2analytics/how-to-raise-money-on-kickstarter" target="_blank">this link</a>.)</div>
<div>
<h2>Qs for Exploratory Analysis:</h2>
<p>We will start our analysis with the aim of answering the following questions:</p>
<ol>
<li>
<ol>
<li>How many projects were successful on Kickstarter, by year and category.</li>
<li>Which sub-categories raised the most amount of money?</li>
<li>Projects originate from which countries?</li>
<li>How many projects exceeded their funding goal by 50% or more?</li>
<li>Did any projects reach $100,000 or more? $1,000,000 or higher?</li>
<li>What was the average amount contributed by each backer, and how does this change over time? Does this amount differ with categories?</li>
<li>What is the average funding period?</li>
</ol>
</li>
</ol>
<p> </p>
<p><span>Predicting success rates:</span></p>
</div>
<div>
<p>Using the answers from the above questions, we will try to create a model that can predict which projects are most likely to be successful.</p>
<p>If you find this tutorial useful or interesting, then please do upvote the <a rel="nofollow" href="https://www.kaggle.com/anu2analytics/how-to-raise-money-on-kickstarter" target="_blank">kernel</a> ! <img alt="🙂" src="https://i0.wp.com/s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f642.png?w=456&ssl=1" class="wp-smiley" data-recalc-dims="1"></p>
</div>
<div>
<h2>Step1 – Data Pre-processing</h2>
<div>
<h3>a) Let us take a look at the input dataset :</h3>
<pre><code>## 
Read 68.7% of 378661 rows
Read 378661 rows and 14 (of 14) columns from 0.051 GB file in 00:00:03</code></pre>
<pre><code>## 'data.frame':    378661 obs. of  14 variables:
##  $ ID              : int  1000002330 1000003930 1000004038 1000007540 1000011046 1000014025 1000023410 1000030581 1000034518 100004195 ...
##  $ name            : chr  &quot;The Songs of Adelaide &amp; Abullah&quot; &quot;Greeting From Earth: ZGAC Arts Capsule For ET&quot; &quot;Where is Hank?&quot; &quot;ToshiCapital Rekordz Needs Help to Complete Album&quot; ...
##  $ category        : chr  &quot;Poetry&quot; &quot;Narrative Film&quot; &quot;Narrative Film&quot; &quot;Music&quot; ...
##  $ main_category   : chr  &quot;Publishing&quot; &quot;Film &amp; Video&quot; &quot;Film &amp; Video&quot; &quot;Music&quot; ...
##  $ currency        : chr  &quot;GBP&quot; &quot;USD&quot; &quot;USD&quot; &quot;USD&quot; ...
##  $ deadline        : chr  &quot;2015-10-09&quot; &quot;2017-11-01&quot; &quot;2013-02-26&quot; &quot;2012-04-16&quot; ...
##  $ goal            : num  1000 30000 45000 5000 19500 50000 1000 25000 125000 65000 ...
##  $ launched        : chr  &quot;2015-08-11 12:12:28&quot; &quot;2017-09-02 04:43:57&quot; &quot;2013-01-12 00:20:50&quot; &quot;2012-03-17 03:24:11&quot; ...
##  $ pledged         : num  0 2421 220 1 1283 ...
##  $ state           : chr  &quot;failed&quot; &quot;failed&quot; &quot;failed&quot; &quot;failed&quot; ...
##  $ backers         : int  0 15 3 1 14 224 16 40 58 43 ...
##  $ country         : chr  &quot;GB&quot; &quot;US&quot; &quot;US&quot; &quot;US&quot; ...
##  $ usd.pledged     : num  0 100 220 1 1283 ...
##  $ usd_pledged_real: num  0 2421 220 1 1283 ...</code></pre>
<p>The projects are divided into main and sub-categories. The pledged amount “usd_pledged” has an equivalent value converted to USD, called “usd_pledged_real”. However, the goal amount does not have this conversion. So for now, we will use the amounts as is.</p>
<p>We can see how many people are backing each individual project using the column, “backers”.</p>
</div>
<div>
<h3>b) Now let us look at the first 5 records:</h3>
<p>The name doesn’t really indicate any specific pattern although it might be interesting to see if longer names have better success rates. Not pursuing that angle at this time, though.</p>
<pre><code>##           ID                                                       name
## 1 1000002330                            The Songs of Adelaide &amp; Abullah
## 2 1000003930              Greeting From Earth: ZGAC Arts Capsule For ET
## 3 1000004038                                             Where is Hank?
## 4 1000007540          ToshiCapital Rekordz Needs Help to Complete Album
## 5 1000011046 Community Film Project: The Art of Neighborhood Filmmaking
## 6 1000014025                                       Monarch Espresso Bar
##         category main_category currency   deadline  goal
## 1         Poetry    Publishing      GBP 2015-10-09  1000
## 2 Narrative Film  Film &amp; Video      USD 2017-11-01 30000
## 3 Narrative Film  Film &amp; Video      USD 2013-02-26 45000
## 4          Music         Music      USD 2012-04-16  5000
## 5   Film &amp; Video  Film &amp; Video      USD 2015-08-29 19500
## 6    Restaurants          Food      USD 2016-04-01 50000
##              launched pledged      state backers country usd.pledged
## 1 2015-08-11 12:12:28       0     failed       0      GB           0
## 2 2017-09-02 04:43:57    2421     failed      15      US         100
## 3 2013-01-12 00:20:50     220     failed       3      US         220
## 4 2012-03-17 03:24:11       1     failed       1      US           1
## 5 2015-07-04 08:35:03    1283   canceled      14      US        1283
## 6 2016-02-26 13:38:27   52375 successful     224      US       52375
##   usd_pledged_real
## 1                0
## 2             2421
## 3              220
## 4                1
## 5             1283
## 6            52375</code></pre>
</div>
<div>
<h3>c) Looking for missing values:</h3>
<p>Hurrah, a really clean dataset, even after searching for “empty” strings. <img alt="🙂" src="https://i0.wp.com/s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f642.png?w=456&ssl=1" class="wp-smiley" data-recalc-dims="1"></p>
<pre><code><span># Check for NAs:</span>
sapply(ksdf, <span>function</span>(x) sum(is.na(x)))</code></pre>
<pre><code>##               ID             name         category    main_category 
##                0                0                0                0 
##         currency         deadline             goal         launched 
##                0                0                0                0 
##          pledged            state          backers          country 
##                0                0                0                0 
##      usd.pledged usd_pledged_real 
##             3797                0</code></pre>
<pre><code><span># Check for empty strings:</span>
nrow(subset(ksdf, is.na(ksdf$name)))</code></pre>
<pre><code>## [1] 0</code></pre>
</div>
<div>
<h3> d) Date Formatting and splitting:</h3>
<p>We have two dates in our dataset – “launch date” and “deadline date”.We convert them from strings to date format.<br>
We also split these dates into the respective year and month columns, so that we can plot variations over time.<br>
So we will now have 4 new columns: launch_year, launch_month, deadline_year and deadline_month.</p>
<p><span>Exploratory analysis:</span></p>
</div>
</div>
<div>
<div>
<h3>a) How many projects are successful?</h3>
<pre><code>prop.table(table(ksdf$state))*<span>100</span></code></pre>
<pre><code>## 
##   canceled     failed       live successful  suspended  undefined 
## 10.2410864 52.2153060  0.7391836 35.3762336  0.4875073  0.9406831</code></pre>
<p>We see that “failed” and “successful” are the two main categories, comprising ~88% of our dataset.<br>
Sadly we do not know why some projects are marked “undefined” or “canceled”.<br>
“live”” projects are those where the deadlines have not yet passed, although a few among them are already achieved their goal.<br>
Surprisingly, some ‘canceled’ projects had also met their goals (pledged_amount >= goal).<br>
Since these other categories are a very small portion of the dataset, we will subset and only consider records with satus “failed” or “successful” for the rest of the analysis.</p>
<p><span>b) How many countries have projects on kickstarter?</span></p>
</div>
<div>
<pre><code>## 
##     AT     AU     BE     CA     CH     DE     DK     ES     FR     GB 
##    485   6616    523  12370    652   3436    926   1873   2520  29454 
##     HK     IE     IT     JP     LU     MX  N,0&quot;&quot;     NL     NO     NZ 
##    477    683   2369     23     57   1411    210   2411    582   1274 
##     SE     SG     US 
##   1509    454 261360</code></pre>
<p>We see projects are overwhelmingly US. Some country names have the tag N,0“”, so marking them as unknown.</p>
<p><span>c) Number of projects launched per year:</span></p>
</div>
<div>
<pre><code>## 
##  2009  2010  2011  2012  2013  2014  2015  2016  2017 
##  1179  9577 24049 38480 41101 59306 65272 49292 43419</code></pre>
<p>Looks like some records say dates like 1970, which does not look right. So we discard any records with a launch / deadline year before 2009.<br>
Plotting the counts per year on a graphs: &lt; br />From the graph below, it looks like the count of projects peaked in 2015, then went down. However, this should NOT be taken as an indicator of success rates.</p>
<p> </p>
<p><img src="https://i0.wp.com/www.kaggle.io/svf/2329821/caacae2f53babeef66096c49e67fabec/__results___files/figure-html/unnamed-chunk-11-1.png?w=450&ssl=1" data-recalc-dims="1"></p>
<p> </p>
<p>Drilling down a bit more to see count of projects by main_category.</p>
<p><img src="https://i2.wp.com/www.kaggle.io/svf/2329821/caacae2f53babeef66096c49e67fabec/__results___files/figure-html/unnamed-chunk-12-1.png?w=450&ssl=1" data-recalc-dims="1"></p>
<p>Over the years, maximum number of projects have been in the categories:</p>
<ol>
<li>
<ol>
<li>Film &amp; Video</li>
<li>Music</li>
<li>Publishing</li>
</ol>
</li>
</ol>
</div>
<div>
<h3> d) Number of projects by sub-category: (Top 20 only)</h3>
<p><img src="https://i0.wp.com/www.kaggle.io/svf/2329821/caacae2f53babeef66096c49e67fabec/__results___files/figure-html/unnamed-chunk-13-1.png?w=450&ssl=1" data-recalc-dims="1"><br>
The Top 5 sub-categories are:</p>
<ol>
<li>
<ol>
<li>Product Design</li>
<li>Documentary</li>
<li>Music</li>
<li>Tabletop Games (interesting!!!)</li>
<li>Shorts (really?! )</li>
</ol>
</li>
</ol>
<p>Let us now see “Status” of projects for these Top 5 sub_categories:<br>
From the graph below, we see that for category “shorts” and “tabletop games” there are more successfull projects than failed ones.<br>
<img src="https://i0.wp.com/www.kaggle.io/svf/2329821/caacae2f53babeef66096c49e67fabec/__results___files/figure-html/unnamed-chunk-14-1.png?w=450&ssl=1" data-recalc-dims="1"></p>
</div>
<div>
<h3> e) Backers by category and sub-category:</h3>
<p><img src="https://i1.wp.com/www.kaggle.io/svf/2329821/caacae2f53babeef66096c49e67fabec/__results___files/figure-html/unnamed-chunk-15-1.png?w=450&ssl=1" data-recalc-dims="1"></p>
<p>Since there are a lot of sub-categories, let us explore the sub-categories under the main theme “Design” <img src="https://i2.wp.com/www.kaggle.io/svf/2329821/caacae2f53babeef66096c49e67fabec/__results___files/figure-html/unnamed-chunk-16-1.png?w=450&ssl=1" data-recalc-dims="1"></p>
<p>Product design is not just the sub-category with the highest count of projects, but also the category with the highest success ratio.</p>
</div>
<div>
<h3> f) add flag to see how many got funded more than the goal.</h3>
<pre><code>ksdf$goal_flag &lt;- ifelse(ksdf$pledged >= ksdf$goal, <span>1</span>, <span>0</span>)
prop.table(table(ksdf$goal_flag))*<span>100</span></code></pre>
<pre><code>## 
##        0        1 
## 59.61197 40.38803</code></pre>
<p>So ~40% of projects reached or surpassed their goal, which matches the number of successful projects .</p>
</div>
<div>
<h3> g) Calculate average contribution per backer:</h3>
<p>From the mean, median and max values we quickly see that the median amount contributed by each backer is only ~$40 whereas the mean is higher due to the extreme positive values. The max amount by a single backer is ~$5000.</p>
<pre><code>summary(ksdf$contrib)</code></pre>
<pre><code>##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
##     0.00    16.00    41.78    73.35    78.00 50000.00</code></pre>
<pre><code>hist(n$contrib, main = <span>&quot;Histogram for number of contributors&quot;</span>)</code></pre>
<p><img src="https://i0.wp.com/www.kaggle.io/svf/2329821/caacae2f53babeef66096c49e67fabec/__results___files/figure-html/unnamed-chunk-19-1.png?w=450&ssl=1" data-recalc-dims="1"></p>
</div>
<div>
<h3>h) Calculate reach_ratio</h3>
<p>The amount per backer is a good start, but what if the goal amount itself is only $1000? Then an average contribution per backer of $50 impies we only need 20 backers.<br>
So to better understand the probability of a project’s success, we create a derived metric called “reach_ratio”.<br>
This takes the average user contribution and compares it against the goal fund amount.</p>
<pre><code>##      Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
##      0.00      0.16      0.75      6.17      2.16 166666.67</code></pre>
<p>We see the median reach_ratio is &lt;1%. Only in the third quartile do we even touch 2%!<br>
Clearly most projects have a very low reach ratio. We could subset for “successful” projects only and check if the reach_ratio is higher.<br>
<img src="https://i0.wp.com/www.kaggle.io/svf/2329821/caacae2f53babeef66096c49e67fabec/__results___files/figure-html/unnamed-chunk-21-1.png?w=450&ssl=1" data-recalc-dims="1"></p>
</div>
<div>
<h3> i) Number of days to achieve goal:</h3>
<p>Most projects are run for a month, as seen from graph below.</p>
<p><img src="https://i0.wp.com/www.kaggle.io/svf/2329821/caacae2f53babeef66096c49e67fabec/__results___files/figure-html/unnamed-chunk-22-1.png?w=450&ssl=1" data-recalc-dims="1"></p>
</div>
</div>
<div>
<h2>Predictive Analystics:</h2>
<p>We will apply a very simple decision tree algorithm to our dataset.<br>
Since we do not have a separate “test” set, we will split the input dataframe into 2 parts (70/30 split).<br>
We will use the smaller set to test the accuracy of out algorithm.</p>
<pre><code>ksdf$status = ifelse(ksdf$state == <span>'failed'</span>, <span>0</span>, <span>1</span>)

<span>## 70% of the sample size</span>
smp_size &lt;- floor(<span>0.7</span> * nrow(ksdf))

<span>## set the seed to make your partition reproductible</span>
set.seed(<span>486</span>)
train_ind &lt;- sample(seq_len(nrow(ksdf)), size = smp_size)

train &lt;- ksdf[train_ind, ]
test &lt;- ksdf[-train_ind, ]</code></pre>
<pre><code><span>library</span>(tree)
tree1 &lt;- tree(status ~ goal + reach_ratio + category + backers + country + launch_year , data = train)</code></pre>
<pre><code>## Warning in tree(status ~ goal + reach_ratio + category + backers + country
## + : NAs introduced by coercion</code></pre>
<pre><code>summary(tree1)</code></pre>
<pre><code>## 
## Regression tree:
## tree(formula = status ~ goal + reach_ratio + category + backers + 
##     country + launch_year, data = train)
## Variables actually used in tree construction:
## [1] &quot;backers&quot;     &quot;reach_ratio&quot;
## Number of terminal nodes:  9 
## Residual mean deviance:  0.02429 = 5640 / 232200 
## Distribution of residuals:
##       Min.    1st Qu.     Median       Mean    3rd Qu.       Max. 
## -0.9816000 -0.0006945 -0.0006945  0.0000000  0.0410400  0.9993000</code></pre>
<p>Taking a peek at the decision tree rules:</p>
<pre><code>plot(tree1)
text(tree1 ,pretty =<span>0</span>)</code></pre>
<div data-shortcode="caption" class="wp-caption"><img alt="kickstarter success decision tree" width="450" src="https://i1.wp.com/blog.journeyofanalytics.com/wp-content/uploads/2018/02/kickstarter.jpg" class="wp-image-311">
<p class="wp-caption-text">kickstarter success decision tree</p>
</div>
<pre><code>tree1</code></pre>
<pre><code>## node), split, n, deviance, yval
##       * denotes terminal node
## 
##  1) root 232172 55900.00 0.4039000  
##    2) backers &lt; 17.5 121911  9326.00 0.0834600  
##      4) reach_ratio &lt; 5.88118 107986    74.95 0.0006945 *
##      5) reach_ratio > 5.88118 13925  2774.00 0.7253000  
##       10) backers &lt; 5.5 4723  1031.00 0.3218000  
##         20) reach_ratio &lt; 19.9667 2792     0.00 0.0000000 *
##         21) reach_ratio > 19.9667 1931   323.50 0.7872000 *
##       11) backers > 5.5 9202   580.00 0.9324000 *
##    3) backers > 17.5 110261 20210.00 0.7583000  
##      6) reach_ratio &lt; 0.79672 40852 10190.00 0.5217000  
##       12) backers &lt; 128.5 16858    39.91 0.0023730 *
##       13) backers > 128.5 23994  2413.00 0.8866000 *
##      7) reach_ratio > 0.79672 69409  6383.00 0.8975000  
##       14) backers &lt; 35.5 20535  3836.00 0.7514000  
##         28) reach_ratio &lt; 2.85458 4816     0.00 0.0000000 *
##         29) reach_ratio > 2.85458 15719   284.60 0.9816000 *
##       15) backers > 35.5 48874  1924.00 0.9590000 *</code></pre>
<p>Thus we see that “backers” and “reach-ratio” are the main significant variables.</p>
<p>Re-applying the tree rules to the training set itself, we can validate our model:</p>
<pre><code>Predt &lt;- predict(tree1, train)</code><code></code></pre>
<pre><code>validf &lt;- data.frame( kickstarter_id = train$ID, orig_status = train$status, new_status = Predt)
validf$new = ifelse(validf$new_status &lt; <span>0.5</span>, <span>0</span>, <span>1</span>)

<span># contingency Tables:</span>
table(validf$orig_status, validf$new)</code></pre>
<pre><code>##    
##          0      1
##   0 132337   6051
##   1    115  93669</code></pre>
<pre><code><span># Area under the curve</span>
<span>library</span>(pROC)
auc(validf$orig_status, validf$new)</code></pre>
<pre><code>## Area under the curve: 0.9775</code></pre>
<p>From the above tables, we see that the error rate = ~3% and area under curve >= 97%</p>
<p>Finally applying the tree rules to the test set, we get the following stats:</p>
<pre><code>Pred1 &lt;- predict(tree1, test)</code></pre>
<pre><code></code><code></code></pre>
<p>From the above tables, we see that still the error rate = ~3% and area under curve >= 97%</p>
<p> </p>
</div>
<div>
<h2>Conclusion:</h2>
<p>Thus in this tutorial, we explored the factors that contribtue to a project’s success. Main theme and sub-category were important, but the number of backers and “reach_ratio” were found to be most critical.<br>
If a founder wanted to gauge their probability of success, they could measure their “reach-ratio” halfway to the deadline, or perhaps when 25% of the timeline is complete. If the numbers are lower, it means they need to double down and use promotions/social media marketing to get more backers and funding.</p>
<p>If you liked this tutorial, feel free to fork the script. And don’t forget to upvote the kernel! <img alt="🙂" src="https://i0.wp.com/s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f642.png?w=456&ssl=1" class="wp-smiley" data-recalc-dims="1"></p>
</div>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://journeyofanalytics.wordpress.com/2018/02/03/raise-money-on-kickstarter/"> R – Journey of Analytics</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/AFRJzEZHLo8" height="1"></a></div>