DOI: 10.7910/dvn/sg3lp1
title: Replication Data for: Revisiting 'The Rise and Decline' in a Population of Peer Production Projects

description: &lt;p&gt;This archive contains code and data for reproducing the analysis for “Replication Data for Revisiting ‘The Rise and Decline’ in a Population of Peer Production Projects”. Depending on what you hope to do with the data you probabbly do not want to download all of the files. Depending on your computation resources you may not be able to run all stages of the analysis.&lt;/p&gt;
&lt;p&gt;The code for all stages of the analysis, including typesetting the manuscript and running the analysis, is in code.tar.&lt;/p&gt;
&lt;p&gt;If you only want to run the final analysis or to play with datasets used in the analysis of the paper, you want intermediate_data.7z or the uncompressed tab and csv files.&lt;/p&gt;
&lt;p&gt;The data files are created in a four-stage process. The first stage uses the program “wikiq” to parse mediawiki xml dumps and create tsv files that have edit data for each wiki. The second stage generates all.edits.RDS file which combines these tsvs into a dataset of edits from all the wikis. This file is expensive to generate and at 1.5GB is pretty big. The third stage builds smaller intermediate files that contain the analytical variables from these tsv files. The fourth stage uses the intermediate files to generate smaller RDS files that contain the results. Finally, knitr and latex typeset the manuscript.&lt;/p&gt;
&lt;p&gt;A stage will only run if the outputs from the previous stages do not exist. So if the intermediate files exist they will not be regenerated. Only the final analysis will run. The exception is that stage 4, fitting models and generating plots, always runs.&lt;/p&gt;
&lt;p&gt;If you only want to replicate from the second stage onward, you want wikiq_tsvs.7z. If you want to replicate everything, you want wikia_mediawiki_xml_dumps.7z.001 wikia_mediawiki_xml_dumps.7z.002, and wikia_mediawiki_xml_dumps.7z.003.&lt;/p&gt;
&lt;p&gt;These instructions work backwards from building the manuscript using knitr, loading the datasets, running the analysis, to building the intermediate datasets.&lt;/p&gt;
&lt;h2 id="building-the-manuscript-using-knitr"&gt;Building the manuscript using knitr&lt;/h2&gt;
&lt;p&gt;This requires working latex, latexmk, and knitr installations. Depending on your operating system you might install these packages in different ways. On Debian Linux you can run &lt;code&gt;apt install r-cran-knitr latexmk texlive-latex-extra&lt;/code&gt;. Alternatively, you can upload the necessary files to a project on Overleaf.com.&lt;/p&gt;
&lt;ol type="1"&gt;
&lt;li&gt;Download &lt;code&gt;code.tar&lt;/code&gt;. This has everything you need to typeset the manuscript.&lt;/li&gt;
&lt;li&gt;Unpack the tar archive. On a unix system this can be done by running &lt;code&gt;tar xf code.tar&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Navigate to code/paper_source.&lt;/li&gt;
&lt;li&gt;Install R dependencies. In R. run &lt;code&gt;install.packages(c(&quot;data.table&quot;,&quot;scales&quot;,&quot;ggplot2&quot;,&quot;lubridate&quot;,&quot;texreg&quot;))&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;On a unix system you should be able to run &lt;code&gt;make&lt;/code&gt; to build the manuscript &lt;code&gt;generalizable_wiki.pdf&lt;/code&gt;. Otherwise you should try uploading all of the files (including the tables, figure, and knitr folders) to a new project on Overleaf.com.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="loading-intermediate-datasets"&gt;Loading intermediate datasets&lt;/h2&gt;
&lt;p&gt;The intermediate datasets are found in the &lt;code&gt;intermediate_data.7z&lt;/code&gt; archive. They can be extracted on a unix system using the command &lt;code&gt;7z x intermediate_data.7z&lt;/code&gt;. The files are 95MB uncompressed. These are RDS (R data set) files and can be loaded in R using the &lt;code&gt;readRDS&lt;/code&gt;. For example &lt;code&gt;newcomer.ds &lt;- readRDS(&quot;newcomers.RDS&quot;)&lt;/code&gt;. If you wish to work with these datasets using a tool other than R, you might prefer to work with the .tab files.&lt;/p&gt;
&lt;h2 id="running-the-analysis"&gt;Running the analysis&lt;/h2&gt;
&lt;p&gt;Fitting the models may not work on machines with less than 32GB of RAM. If you have trouble, you may find the functions in lib-01-sample-datasets.R useful to create stratified samples of data for fitting models. See line 89 of 02_model_newcomer_survival.R for an example.&lt;/p&gt;
&lt;ol type="1"&gt;
&lt;li&gt;Download &lt;code&gt;code.tar&lt;/code&gt; and &lt;code&gt;intermediate_data.7z&lt;/code&gt; to your working folder and extract both archives. On a unix system this can be done with the command &lt;code&gt;tar xf code.tar &amp;&amp; 7z x intermediate_data.7z&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Install R dependencies. &lt;code&gt;install.packages(c(&quot;data.table&quot;,&quot;ggplot2&quot;,&quot;urltools&quot;,&quot;texreg&quot;,&quot;optimx&quot;,&quot;lme4&quot;,&quot;bootstrap&quot;,&quot;scales&quot;,&quot;effects&quot;,&quot;lubridate&quot;,&quot;devtools&quot;,&quot;roxygen2&quot;))&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;On a unix system you can simply run &lt;code&gt;regen.all.sh&lt;/code&gt; to fit the models, build the plots and create the RDS files.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="generating-datasets"&gt;Generating datasets&lt;/h2&gt;
&lt;h3 id="building-the-intermediate-files"&gt;Building the intermediate files&lt;/h3&gt;
&lt;p&gt;The intermediate files are generated from all.edits.RDS. This process requires about 20GB of memory.&lt;/p&gt;
&lt;ol type="1"&gt;
&lt;li&gt;Download &lt;code&gt;all.edits.RDS&lt;/code&gt;, &lt;code&gt;userroles_data.7z&lt;/code&gt;,&lt;code&gt;selected.wikis.csv&lt;/code&gt;, and &lt;code&gt;code.tar&lt;/code&gt;. Unpack &lt;code&gt;code.tar&lt;/code&gt; and &lt;code&gt;userroles_data.7z&lt;/code&gt;. On a unix system this can be done using &lt;code&gt;tar xf code.tar &amp;&amp; 7z x userroles_data.7z&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Install R dependencies. In R run &lt;code&gt;install.packages(c(&quot;data.table&quot;,&quot;ggplot2&quot;,&quot;urltools&quot;,&quot;texreg&quot;,&quot;optimx&quot;,&quot;lme4&quot;,&quot;bootstrap&quot;,&quot;scales&quot;,&quot;effects&quot;,&quot;lubridate&quot;,&quot;devtools&quot;,&quot;roxygen2&quot;))&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;01_build_datasets.R&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="building-all.edits.rds"&gt;Building all.edits.RDS&lt;/h3&gt;
&lt;p&gt;The intermediate RDS files used in the analysis are created from &lt;code&gt;all.edits.RDS&lt;/code&gt;. To replicate building all.edits.RDS, you only need to run 01_build_datasets.R when the intermediate RDS files and &lt;code&gt;all.edits.RDS&lt;/code&gt; files do not exist in the working directory. &lt;code&gt;all.edits.RDS&lt;/code&gt; is generated from the tsv files generated by wikiq. This may take several hours. By default building the dataset will use all available CPU cores. If you want to change this, modify line 26 of &lt;code&gt;lib-01-build_newcomer_table.R&lt;/code&gt;.&lt;/p&gt;
&lt;ol type="1"&gt;
&lt;li&gt;Download selected.wikis.csv, userroles_data.7z, wikiq_tsvs.7z, and code.tar. Unpack the files. On a unix system this can be done by running &lt;code&gt;7z x userroles_data.7z &amp;&amp; 7z x wikiq_tsvs.7z &amp;&amp; tar xf code.tar&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;01_build_datasets.R&lt;/code&gt; to generate all.edits.RDS and the intermediate files.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="running-wikiq-to-generate-tsv-files"&gt;Running Wikiq to generate tsv files&lt;/h3&gt;
&lt;p&gt;If you want to regenerate the datasets all the way from the xml dumps and data from the Wikia api you will have to run the python script &lt;code&gt;wikiq&lt;/code&gt;. This is a fairly computationally intensive process. It may several days unless you can run the computations in parallel.&lt;/p&gt;
&lt;ol type="1"&gt;
&lt;li&gt;Download &lt;code&gt;code.tar&lt;/code&gt;, &lt;code&gt;wikia_mediawiki_xml_dumps.7z.001&lt;/code&gt;, &lt;code&gt;wikia_mediawiki_xml_dumps.7z.002&lt;/code&gt;, and &lt;code&gt;userroles_data.7z&lt;/code&gt;. Extract the archives. On a Unix system this can be done by running &lt;code&gt;tar xf code.tar &amp;&amp; 7z x wikia_mediawiki_xml_dumps.7z.001 &amp;&amp; 7z x userroles_data.7z&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Have python3 and python3-pip installed. Using pip3 install &lt;code&gt;argparse&lt;/code&gt;. &lt;code&gt;pip3 install argparse&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Edit &lt;code&gt;runwikiq.sh&lt;/code&gt; to set N_THREADS.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;runwikiq.sh&lt;/code&gt; to generate the tsv files.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="obtaining-bot-and-admin-data-from-the-wikia-api"&gt;Obtaining Bot and Admin data from the Wikia API&lt;/h3&gt;
&lt;p&gt;For the purposes of supporting an audit of our research project, this repository includes the code that we used to obtain Bot and Admin data from the Wikia API. Unfortunantly, since we ran the script, the API has changed and this code does not work.&lt;/p&gt;
&lt;p&gt;Our research group maintains a tool for scraping the Wikia API available at code.communitydata.cc/wikia_userroles_scraper. This can be used to download user roles for the wikis in this dataset.&lt;/p&gt;
&lt;h4 id="license"&gt;License&lt;/h4&gt;
&lt;p&gt;Copyright (C) 2018 Nathan TeBlunthuis. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the file entitled “fdl-1.3.md”.&lt;/p&gt;
description: Wikia.com