Quick start with R: Box plots (Part 13)

In Part 13, let’s see how to create boxplots in R. Let’s create a simple boxplot using the boxplot() command, which is easy to use. First, we set up a vector of numbers and then we plot them. Boxplots can be created for individual variables or for variables by group….

Quick start with R: Histograms (Part 12)

In Part 12, let’s see how to create histograms in R. Let’s create a simple histogram using the hist() command, which is easy to use, but actually quite sophisticated. First, we set up a vector of numbers and then we create a histogram. B <- c(2, 4, 5, 7, 12,…

Quick start with R: Bar charts (Part 11)

In Part 11, let’s see how to create bar charts in R. Let’s create a simple bar chart using the barplot() command, which is easy to use. First, we set up a vector of numbers. Then we count them using the table() command, and then we plot them. The table()…

Quick start with R: aggregate() command (Part 10)

In Part 10, let’s look at the aggregate() command for creating summary tables using R. You may have a complex dataset that includes categorical variables of several levels, and you may wish to create summary tables for each level of the categorical variable. For example, your dataset may include the…

Quick start with R: Sub-setting (Part 9)

In Part 9, let’s look at sub-setting in R. Let’s provide summary tables on the following data set of tourists from different countries, the numbers of their children, and the amount of money they spent while on vacation. Copy and paste the following array into R. A <- structure(list(NATION =…

Quick start with R: Basic commands (Part 8)

In Part 8, let’s look at some basic commands in R. Set up the following vectors by cutting and pasting from this document: a <- c(3,-7,-3,-9,3,-1,2,-12, -14) b <- c(3,7,-5, 1, 5,-6,-9,16, -8) d <- c(1,2,3,4,5,6,7,8,9) Now figure out what each of the following commands do. You should not need…

Using Sample Size Calculator application

The following video tutorial gives a brief overview of the Sample Size Calculator application. The Sample Size Calculator is an interactive Shiny application which allows you to calculate sample size when estimating population mean value or population proportion.   [su_youtube_advanced url=”https://www.youtube.com/watch?v=7juKRR-Kahs” rel=”no”]

Quick start with R: Further plotting (Part 7)

In Part 7, let’s look at further plotting in R. Try entering the following three commands to create three variables. X <- c(3, 4, 6, 6, 7, 8, 9, 12) B1 <- c(4, 5, 6, 7, 17, 18, 19, 22) B2 <- c(3, 5, 8, 10, 19, 21, 22, 26)…

Quick start with R: Basic plotting (Part 6)

In Part 6, let’s look at basic plotting in R. Try entering the following three commands together (the semi-colon allows you to place several commands on the same line). x <- seq(-4, 4, 0.2) ;  y <- 2*x^2 + 4*x – 7 plot(x, y) This is a very basic plot,…