Examining Data Exercises

[This article was first published on R-exercises, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

examining data solutions-3One of the first steps of data analysis is the descriptive analysis; this helps to understand how the data is distributed and provides important information for further steps. This set of exercises will include functions useful for one variable descriptive analysis, including graphs. Before proceeding, it might be helpful to look over the help pages for the length, range, median, IQR, hist, quantile, boxplot, and stem functions.

For this set of exercises you will use a dataset called islands, an R dataset that contains the areas of the world’s major landmasses expressed in squared miles. To load the dataset run the following instruction: data(islands).

Answers to the exercises are available here.

If you obtained a different (correct) answer than those listed on the solutions page, please feel free to post your answer as a comment on that page.

Exercise 1

Load the islands dataset and obtain the total number of observations.

Exercise 2

Measures of central tendency. Obtain the following statistics of islands

a)Mean
b)Median

Exercise 3

Using the function range, obtain the following values:

a)Size of the biggest island
b)Size of the smallest island

Exercise 4

Measures of dispersion. Find the following values for islands:

a)Standard deviation
b)The range of the islands size using the function range.

Exercise 5

Quantiles. Using the function quantile obtain a vector including the following quantiles:

a) 0%, 25%, 50%, 75%, 100%
b) .05%, 95%

Exercise 6

Interquartile range. Find the interquartile range of islands.

Exercise 7

Create an histogram of islands with the following properties.

a) Showing the frequency of each group
b) Showing the proportion of each group

Exercise 8

Create box-plots with the following conditions

a) Including outiers
b) Without outliers

Exercise 9

Using the function boxplot find the outliers of islands. Hint: use the argument prob=F.

Exercise 10

Create a stem and leaf plot of islands

To leave a comment for the author, please follow the link and comment on their blog: R-exercises.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

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)