Publications by Anna Shirokanova
Animated Charts in R
Animated lollipop chart library(ggplot2) library(gganimate) library(dplyr) df <- readxl::read_excel("longit_data.xlsx") str(df) # Index is how much interest there is in a Subject over seasons where Index = 100 for 1.1.2019 ## tibble [15 x 3] (S3: tbl_df/tbl/data.frame) ## $ Quarter: POSIXct[1:15], format: "2019-01-01" "2019-01-01" ... ## ...
63 sym R (3045 sym/12 pcs) 5 img
Introduction and Basic Data Manipulation in R
Introduction and Basic Data Manipulation Olesya Volchenko, Anna Shirokanova January 13, 2021 What’s going on? We are learning how to analyze data We are using R programming language That looks somehow like that: Stages of R 1st stage - denial 2nd stage - anger 3rd stage - bargaining 4th stage - depression 5th stage - acceptance Structur...
6937 sym R (20053 sym/125 pcs) 17 img
Putting a Logo on a Plot in R
If you always want a logo on your plots, consider adding it to the settings to your R Markdown reports. Let’s look into two ways to add a logo to a single plot. The first way to add a logo to a picture quickly is via annotations: library(ggplot2) library(png) library(grid) # to put an image at a given location library(gridExtra) # functions ...
820 sym R (4527 sym/10 pcs) 6 img
Introduction to the t-test
Comparing Two Means Anna Shirokanova and Olesya Volchenko March 11, 2021 Let’s compare mean values Mean values refer to continuous variables. Mean values can be compared across groups. If there are two groups, t-test is the parametric test you need to make a conclusion about the two populations. If there are more than two groups, use one-wa...
10079 sym R (7943 sym/42 pcs) 18 img
Correlations in R
Correlation analysis: practice Anna Shirokanova & Olesya Volchenko April 15, 2021 This seminar Recap of correlation analysis Examples of correlation analysis Types of correlation How to report correlation results Correlations Probably the most widely spread statistical concept Also widely misused (correlational research is not experimental...
9361 sym R (5828 sym/33 pcs) 14 img 4 tbl
Cluster Analysis 101
Clusters 102 Anna Shirokanova 15 11 2021 Example 1: Fisher’s Irises There are two classic approaches in cluster analysis, top-down (K-means, PAM), and bottom-up (hierarchical clustering). K-means is very fast but keeps it simple (sometimes too simple). Hierarchical clustering, once built, can quickly do solutions for various numbers of clus...
19309 sym R (53291 sym/190 pcs) 63 img 5 tbl
Python Bits from RStudio
This script will show some elements of working in Python from RStudio. version 2, updated. version 1: Jan 19, 2021. R part Here is your main project in R: data <- mtcars str(data) ## 'data.frame': 32 obs. of 11 variables: ## $ mpg : num 21 21 22.8 21.4 18.7 18.1 14.3 24.4 22.8 19.2 ... ## $ cyl : num 6 6 4 6 8 6 8 4 4 6 ... ## $ dis...
1217 sym R (3381 sym/26 pcs) 2 img
Neat Bar Charts
Sources: https://www.youtube.com/watch?v=NDHSBUN_rVU + https://twitter.com/_ColinFay/status/1355132587149303812 + https://sebastiansauer.github.io/percentage_plot_ggplot2_V2/ + https://ggplot2-book.org/annotations.html + https://rpkgs.datanovia.com/ggpubr/reference/background_image.html # Prepare the data df1 <- iris library(palmerpenguins) df...
872 sym R (4186 sym/11 pcs) 7 img
Boxplots-to-go
This is largely a note to my future self. Everyone knows boxplots don’t show mean values but many want them to be there. Here are four options. In our 2022 class, option C was picked as the clearest of the four. a <- ggplot(na.omit(df1), aes(x = wrkctra, y = imbgeco)) + geom_boxplot() + labs(x = "boxplot") + theme_minimal() b <- ggp...
219 sym R (970 sym/1 pcs) 1 img
Examples of Robust Statistics
1 Let’s simulate some data first norm1 <- rnorm(10000,0.5,2) norm2 <- rnorm(10000,0.5,2.3) right <- rbeta(10000,1.5,5) left <- rbeta(10000,5,1) par(mfrow = c(1,4)) hist(norm1) hist(norm2) hist(right) hist(left) dev.off() ## null device ## 1 1.1 trimmed mean options(scipen = 999) min(right) ## [1] 0.0004774916 max(right)...
819 sym R (9476 sym/56 pcs) 2 img