Articles by R on Stats and R

Graphics in R with ggplot2

August 20, 2020 | R on Stats and R

Introduction Data Basic principles of {ggplot2} Create plots with {ggplot2} Scatter plot Line plot Combination of line and points Histogram Density plot Combination of histogram and densities Boxplot Barplot Further personalization Labels Axis ticks Log transformations Limits Legend Shape, color, size and transparency Smooth and regression lines Facets Themes Interactive ...
[Read more...]

Mortgage calculator in R Shiny

August 13, 2020 | R on Stats and R

Introduction Mortgage calculator How to use the mortgage calculator? Code of the app Introduction I recently moved out and bought my first apartment. Of course, I could not pay it entirely with my own savings, so I had to borrow money from the...
[Read more...]

Outliers detection in R

August 10, 2020 | R on Stats and R

Introduction Descriptive statistics Minimum and maximum Histogram Boxplot Percentiles Hampel filter Statistical tests Grubbs’s test Dixon’s test Rosner’s test Additional remarks Introduction An outlier is a value or an observation that is distant from other observations, that is to say, a data point that differs significantly from ...
[Read more...]

Correlation coefficient and correlation test in R

May 27, 2020 | R on Stats and R

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 | R on Stats and R

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 | R on Stats and R

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...]

COVID-19 in Belgium

March 30, 2020 | R on Stats and R

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...]

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

March 2, 2020 | R on Stats and R

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 | R on Stats and R

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 | R on Stats and R

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...]
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)