In this tutorial, we will learn how to compute Pearson correlation of multiple variables. We will use two approaches to compute Pearson correlation of multiple variables in a matrix or dataframe. First we will show how to use cor() function in R to compute Pearson correlation of all variables against all variables. Then we will… Continue reading How to Compute Pearson Correlation of Multiple Variables
Category: R Function
T-test on real data using tidyverse
In this post, we will learn how to perform t-test on a real dataset and use tidyverse framework to access results from t-test. Check out the post how to do t-test to learn base R approach to t-tes. We will use Palmer penguin dataset, a real world dataset, to show how to perform t-test. First,… Continue reading T-test on real data using tidyverse
How to perform t-test in R
In this post, we will learn how top perform t test in R and understand when and why to use it. A t-test is one of the commonly used statistical tests, when one is interested in comparing two groups of measures and determine if there is a significant difference between the mean values of two… Continue reading How to perform t-test in R
How to Find difference between two dates as days, weeks, months and years
In this tutorial we will learn how to find the difference between two date objects in R in terms of days, months, and years. We will learn how to use time_length() function available in tidyverse as part of lubridate package to get the difference as dyas, weeks, months, and years. Let us create two date… Continue reading How to Find difference between two dates as days, weeks, months and years
How to compute annualized return of a stock with tidyverse
In this tutorial, we will learn how to compute annualized return of stock using tidyverse from scratch. Annualized return of an investment is the average returns of the investment that is held over many years. In comparison to simple mean of yearly returns, annualized return is a geometric mean and it accounts for the compounding… Continue reading How to compute annualized return of a stock with tidyverse