Articles by R on Stats and R

Wilcoxon test in R: how to compare 2 groups under the non-normality assumption

June 6, 2020 | 0 Comments

Introduction 2 different scenarios Independent samples Paired samples Introduction In a previous article, we showed how to compare two groups under different scenarios using the Student’s t-test. The Student’s t-test requires that the distributions follow a normal distribution1. In this article, we show how to compare two groups when ...
[Read more...]

How to publish a Shiny app: example with

May 28, 2020 | 0 Comments

Introduction Prerequisite Step-by-step guide Additional notes Introduction The COVID-19 virus led many people to create interactive apps and dashboards. A reader recently asked me how to publish a Shiny app she just created. Similarly to a pre...
[Read more...]

Correlation coefficient and correlation test in R

May 27, 2020 | 0 Comments

Introduction Data Correlation coefficient Between two variables Correlation matrix: correlations for all variables Interpretation of a correlation coefficient Visualizations A scatterplot for 2 variables Scatterplots for several pairs of variables Another simple correlation matrix Correlation test For 2 variables For several pairs of variables Combination of correlation coefficients and correlation tests Introduction ...
[Read more...]

COVID-19 in Belgium: is it over yet?

May 21, 2020 | 0 Comments

Introduction New hospital admissions New confirmed cases Introduction This is a joint work with Prof. Niko Speybroeck and Angel Rosas-Aguirre. Belgium recently started to lift its lockdown measures initially imposed to contain the spread of the...
[Read more...]

One-proportion and goodness of fit test (in R and by hand)

May 12, 2020 | 0 Comments

Introduction In R Data One-proportion test Assumption of prop.test() and binom.test() Chi-square goodness of fit test Does my distribution follow a given distribution? Observed frequencies Expected frequencies Observed vs. expected frequencies By hand One-proportion test Verification in R Goodness of fit test Verification in R Introduction In a ...
[Read more...]

A package to download free Springer books during Covid-19 quarantine

April 25, 2020 | 0 Comments

Introduction Installation Download all books at once Create a table of Springer books Download only specific books By title By author By subject Acknowledgments Introduction You probably already have seen that Springer released about 500 books for free following the COVID-19 pandemic. According to Springer, these textbooks will be available free ...
[Read more...]

COVID-19 in Belgium

March 30, 2020 | 0 Comments

Introduction Top R resources on Coronavirus Coronavirus dashboard for your own country Motivations, limitations and structure of the article Analysis of Coronavirus in Belgium A classic epidemiological model: the SIR model Fitting a SIR model to the Belgium data Reproduction number \(R_0\) Using our model to analyze the outbreak if ...
[Read more...]

How to create a simple Coronavirus dashboard specific to your country in R

March 22, 2020 | 0 Comments

Introduction Top R resources on Coronavirus Coronavirus dashboard: the case of Belgium How to create your own Coronavirus dashboard Additional notes Data Open source Accuracy Coronavirus dashboard: the case of Belgium Introduction The Novel COVID-19 Coronavirus is the hottest topic right now. Every day, the media and newspapers share the ...
[Read more...]

Top 5 R resources on COVID-19 Coronavirus

March 11, 2020 | 0 Comments

R Shiny apps Coronavirus tracker COVID-19 outbreak R packages {nCov2019} R code Analyzing COVID-19 outbreak data with R COVID-19 Data Analysis with {tidyverse} and {ggplot2} Data Photo by CDC The Coronavirus is a serious concern around the...
[Read more...]

How to perform a one sample t-test by hand and in R: test on one mean

March 8, 2020 | 0 Comments

Introduction Null and alternative hypothesis Hypothesis testing Two versions of the one sample t-test How to compute the one sample t-test by hand? Scenario 1: variance of the population is known Scenario 2: variance of the population is unknown How to compute the one sample t-test in R? Scenario 1: variance of the ...
[Read more...]

The 9 concepts and formulas in probability that every data scientist should know

March 2, 2020 | 0 Comments

What is probability? 1. A probability is always between 0 and 1 2. Compute a probability 3. Complement of an event 4. Union of two events 5. Intersection of two events 6. Independence of two events 7. Conditional probability Bayes’ theorem Example 8. Accuracy measures False negatives False positives Sensitivity Specificity Positive predictive value Negative predictive value 9. Counting techniques Multiplication ...
[Read more...]

Student’s t-test in R and by hand: how to compare two groups under different scenarios

February 27, 2020 | 0 Comments

Introduction Null and alternative hypothesis Hypothesis testing Different versions of the Student’s t-test How to compute Student’s t-test by hand? Scenario 1: Independent samples with 2 known variances Scenario 2: Independent samples with 2 equal but unknown variances Scenario 3: Independent samples with 2 unequal and unknown variances Scenario 4: Paired samples where the variance ...
[Read more...]

Getting started in R markdown

February 17, 2020 | 0 Comments

R Markdown: what, why and how? Before you start Components of a .Rmd file YAML header Code chunks Text Code inside text Images Tables Additional notes and useful resources Photo by Jon Tyson If you have spent some time writing code in R, you probably have heard of generating dynamic ...
[Read more...]

The complete guide to clustering analysis: k-means and hierarchical clustering by hand and in R

February 12, 2020 | 0 Comments

What is clustering analysis? Application 1: Computing distances Solution k-means clustering Application 2: k-means clustering Data kmeans() with 2 groups Quality of a k-means partition nstart for several initial centers kmeans() with 3 groups Manual application and verification in R Solution by hand Solution in R Hierarchical clustering Application 3: hierarchical clustering Data Solution by ...
[Read more...]

An efficient way to install and load R packages

January 30, 2020 | 0 Comments

What is a R package and how to use it? Inefficient way to install and load R packages More efficient way What is a R package and how to use it? Unlike other programs, only fundamental functionalities come by default with R. You will thus often need to install some “... [Read more...]

Fisher’s exact test in R: independence test for a small sample

January 27, 2020 | 0 Comments

Introduction Hypotheses Example Data Observed frequencies Expected frequencies Fisher’s exact test in R Conclusion and interpretation References Introduction After presenting the Chi-square test of independence by hand and in R, this article focuses on the Fisher’s exact test. Independence tests are used to determine if there is a ... [Read more...]
1 2

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)