<scriptsrc="../bootstrap-toc.js"></script><!-- Font Awesome icons --><linkrel="stylesheet"href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css"integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk="crossorigin="anonymous">
<p>SPSS (Statistical Package for the Social Sciences) is probably the most well-known software package for statistical analysis. SPSS is easier to learn than R, because in SPSS you only have to click a menu to run parts of your analysis. Because of its user-friendliness, it is taught at universities and particularly useful for students who are new to statistics. From my experience, I would guess that pretty much all (bio)medical students know it at the time they graduate. SAS and Stata are comparable statistical packages popular in big industries.</p>
<p>The <ahref="https://cran.r-project.org/"class="external-link">official R network (CRAN)</a> features more than 16,000 packages at the time of writing, our <code>AMR</code> package being one of them. All these packages were peer-reviewed before publication. Aside from this official channel, there are also developers who choose not to submit to CRAN, but rather keep it on their own public repository, like GitHub. So there may even be a lot more than 14,000 packages out there.</p>
<p>Bottom line is, you can really extend it yourself or ask somebody to do this for you. Take for example our <code>AMR</code> package. Among other things, it adds reliable reference data to R to help you with the data cleaning and analysis. SPSS, SAS and Stata will never know what a valid MIC value is or what the Gram stain of <em>E. coli</em> is. Or that all species of <em>Klebiella</em> are resistant to amoxicillin and that Floxapen<sup>®</sup> is a trade name of flucloxacillin. These facts and properties are often needed to clean existing data, which would be very inconvenient in a software package without reliable reference data. See below for a demonstration.</p>
<p>Because you write the syntax yourself, you can do anything you want. The flexibility in transforming, arranging, grouping and summarising data, or drawing plots, is endless - with SPSS, SAS or Stata you are bound to their algorithms and format styles. They may be a bit flexible, but you can probably never create that very specific publication-ready plot without using other (paid) software. If you sometimes write syntaxes in SPSS to run a complete analysis or to ‘automate’ some of your work, you could do this a lot less time in R. You will notice that writing syntaxes in R is a lot more nifty and clever than in SPSS. Still, as working with any statistical package, you will have to have knowledge about what you are doing (statistically) and what you are willing to accomplish.</p>
<p>Over the last years, <ahref="https://rmarkdown.rstudio.com/"class="external-link">R Markdown</a> has really made an interesting development. With R Markdown, you can very easily produce reports, whether the format has to be Word, PowerPoint, a website, a PDF document or just the raw data to Excel. It even allows the use of a reference file containing the layout style (e.g.fonts and colours) of your organisation. I use this a lot to generate weekly and monthly reports automatically. Just write the code once and enjoy the automatically updated reports at any interval you like.</p>
<p>For an even more professional environment, you could create <ahref="https://shiny.rstudio.com/"class="external-link">Shiny apps</a>: live manipulation of data using a custom made website. The webdesign knowledge needed (JavaScript, CSS, HTML) is almost <em>zero</em>.</p>
<p>Many R users just ask questions on websites like <ahref="https://stackoverflow.com"class="external-link">StackOverflow.com</a>, the largest online community for programmers. At the time of writing, <ahref="https://stackoverflow.com/questions/tagged/r?sort=votes"class="external-link">415,751 R-related questions</a> have already been asked on this platform (that covers questions and answers for any programming language). In my own experience, most questions are answered within a couple of minutes.</p>
<p>And that’s not vice versa I’m afraid. You can import data from any source into R. For example from SPSS, SAS and Stata (<ahref="https://haven.tidyverse.org/"class="external-link">link</a>), from Minitab, Epi Info and EpiData (<ahref="https://cran.r-project.org/package=foreign"class="external-link">link</a>), from Excel (<ahref="https://readxl.tidyverse.org/"class="external-link">link</a>), from flat files like CSV, TXT or TSV (<ahref="https://readr.tidyverse.org/"class="external-link">link</a>), or directly from databases and datawarehouses from anywhere on the world (<ahref="https://dbplyr.tidyverse.org/"class="external-link">link</a>). You can even scrape websites to download tables that are live on the internet (<ahref="https://github.com/hadley/rvest"class="external-link">link</a>) or get the results of an API call and transform it into data in only one command (<ahref="https://github.com/Rdatatable/data.table/wiki/Convenience-features-of-fread"class="external-link">link</a>).</p>
<p>And the best part - you can export from R to most data formats as well. So you can import an SPSS file, do your analysis neatly in R and export the resulting tables to Excel files for sharing.</p>
<p>No strings attached. It was created and is being maintained by volunteers who believe that (data) science should be open and publicly available to everybody. SPSS, SAS and Stata are quite expensive. IBM SPSS Staticstics only comes with subscriptions nowadays, varying <ahref="https://www.ibm.com/products/spss-statistics/pricing"class="external-link">between USD 1,300 and USD 8,500</a> per user <em>per year</em>. SAS Analytics Pro costs <ahref="https://www.sas.com/store/products-solutions/sas-analytics-pro/prodPERSANL.html"class="external-link">around USD 10,000</a> per computer. Stata also has a business model with subscription fees, varying <ahref="https://www.stata.com/order/new/bus/single-user-licenses/dl/"class="external-link">between USD 600 and USD 2,800</a> per computer per year, but lower prices come with a limitation of the number of variables you can work with. And still they do not offer the above benefits of R.</p>
<p>If you are working at a midsized or small company, you can save it tens of thousands of dollars by using R instead of e.g.SPSS - gaining even more functions and flexibility. And all R enthousiasts can do as much PR as they want (like I do here), because nobody is officially associated with or affiliated by R. It is really free.</p>
<p>At present, R is among the world most powerful statistical languages, and it is generally very popular in science (Bollmann <em>et al.</em>, 2017). For all the above reasons, the number of references to R as an analysis method in academic papers <ahref="https://r4stats.com/2014/08/20/r-passes-spss-in-scholarly-use-stata-growing-rapidly/"class="external-link">is rising continuously</a> and has even surpassed SPSS for academic use (Muenchen, 2014).</p>
<p>I believe that the thing with SPSS is, that it has always had a great user interface which is very easy to learn and use. Back when they developed it, they had very little competition, let alone from R. R didn’t even had a professional user interface until the last decade (called RStudio, see below). How people used R between the nineties and 2010 is almost completely incomparable to how R is being used now. The language itself <ahref="https://www.tidyverse.org/packages/"class="external-link">has been restyled completely</a> by volunteers who are dedicated professionals in the field of data science. SPSS was great when there was nothing else that could compete. But now in 2021, I don’t see any reason why SPSS would be of any better use than R.</p>
<spanclass="fu"><ahref="../reference/eucast_rules.html">eucast_rules</a></span><spanclass="op">(</span><spanclass="va">klebsiella_test</span>, info <spanclass="op">=</span><spanclass="cn">FALSE</span><spanclass="op">)</span><spanclass="co"># (the edited data by EUCAST rules)</span>
<p>To work with R, probably the best option is to use <ahref="https://www.rstudio.com/products/rstudio/"class="external-link">RStudio</a>. It is an open-source and free desktop environment which not only allows you to run R code, but also supports project management, version management, package management and convenient import menus to work with other data sources. You can also install <ahref="https://www.rstudio.com/products/rstudio/"class="external-link">RStudio Server</a> on a private or corporate server, which brings nothing less than the complete RStudio software to you as a website (at home or at work).</p>
<p>If you want named variables to be imported as factors so it resembles SPSS more, use <code><ahref="https://haven.tidyverse.org/reference/as_factor.html"class="external-link">as_factor()</a></code>.</p>
<p>To import data from SPSS, SAS or Stata, you can use the <ahref="https://haven.tidyverse.org/"class="external-link">great <code>haven</code> package</a> yourself:</p>
<p>Do not forget about <code><ahref="https://haven.tidyverse.org/reference/as_factor.html"class="external-link">as_factor()</a></code>, as mentioned above.</p>
<p>Developed by <ahref="https://www.rug.nl/staff/m.s.berends/"class="external-link external-link">Matthijs S. Berends</a>, <ahref="https://www.rug.nl/staff/c.f.luz/"class="external-link external-link">Christian F. Luz</a>, <ahref="https://www.rug.nl/staff/a.w.friedrich/"class="external-link external-link">Alexander W. Friedrich</a>, <ahref="https://www.rug.nl/staff/b.sinha/"class="external-link external-link">Bhanu N. M. Sinha</a>, <ahref="https://www.rug.nl/staff/c.j.albers/"class="external-link external-link">Casper J. Albers</a>, <ahref="https://www.rug.nl/staff/c.glasner/"class="external-link external-link">Corinna Glasner</a>.</p>