Blog Archives

Correlogram in R: how to highlight the most correlated variables in a dataset

February 21, 2020
By
Correlogram in R: how to highlight the most correlated variables in a dataset

Introduction Correlation matrix Correlogram Correlation test Code Photo by Pritesh Sudra Introduction Correlation, often computed as part of descriptive statistics, is a statistical tool used to study the relationship between two variables, ...

Read more »

Getting started in R markdown

February 17, 2020
By
Getting started in R markdown

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 reports incorporating R code, R outputs (results) and text or comments. In this article, I will explain how R Markdown...

Read more »

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

February 12, 2020
By
The complete guide to clustering analysis: k-means and hierarchical clustering by hand and in R

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 hand Single linkage Complete linkage Average linkage Solution in R Single linkage Complete linkage Average linkage k-means versus hierarchical clustering References Photo by Nikola Johnny Mirkovic What is clustering analysis? Clustering analysis...

Read more »

An efficient way to install and load R packages

January 30, 2020
By

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 “extensions” to perform the analyses you want. These extensions which are are collections...

Read more »

Do my data follow a normal distribution ? A note on the most widely used distribution and how to test for normality in R

January 28, 2020
By
Do my data follow a normal distribution ? A note on the most widely used distribution and how to test for normality in R

What is a normal distribution? Empirical rule Parameters Probabilities and standard normal distribution Areas under the normal distribution in R and by hand Ex. 1 In R By hand Ex. 2 In R By hand Ex. 3 In R By hand Ex. 4 In R By hand Ex. 5 Why is the normal distribution so crucial in statistics? How to test the normality assumption Histogram Density plot QQ-plot Normality test References What is a normal distribution? The normal distribution is a function that defines how...

Read more »

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

January 27, 2020
By

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 significant relationship between two categorical variables. There exists two different types of independence test: the Chi-square test (the most common) the Fisher’s exact test On...

Read more »

Chi-square test of independence in R

January 26, 2020
By
Chi-square test of independence in R

Introduction Example Data Chi-square test of independence Conclusion and interpretation Introduction This article explains how to perform the Chi-square test of independence in R and how to interpret its results. To learn more about how the test works and how to do it by hand, I invite you to read the article “Chi-square test of independence by hand”. To briefly recap what have been said in...

Read more »

RStudio addins, or how to make your coding life easier

January 25, 2020
By
RStudio addins, or how to make your coding life easier

What are RStudio addins? Installation Addins Esquisse Questionr Recoding factors Reordering factors Categorize a numeric variable Remedy Styler Snakecaser Blogdown What are RStudio addins? Although I have been using RStudio for several years, I only recently discovered RStudio addins. Since then, I am using these addins almost every time I use RStudio. What are RStudio addins? RStudio addins are extensions which provide a simple mechanism for executing advanced R functions from within RStudio....

Read more »

How to create a timeline of your CV in R

January 25, 2020
By
How to create a timeline of your CV in R

Introduction Minimal reproducible example How to personalize it Introduction In this article, I show how to create a timeline of your CV in R. A CV timeline illustrates key information about your education, work experiences and extra activities. The main advantage of CV timelines compared to regular CV is that they make you stand out immediately by being visually appealing and easier to...

Read more »

Descriptive statistics in R

January 21, 2020
By
Descriptive statistics in R

Introduction Data Minimum and maximum Range Mean Median First and third quartile Other quantiles Interquartile range Standard deviation and variance Summary Coefficient of variation Mode Contingency table Barplot Histogram Boxplot Scatterplot QQ-plot For a single variable By groups Density plot Introduction This article explains how to compute the main descriptive statistics in R and how to present them graphically. To learn more about the reasoning behind each descriptive statistics, how to compute them by hand and how to interpret them, read the...

Read more »

Search R-bloggers

Sponsors

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)