0% found this document useful (1 vote)
36 views2 pages

Beginner R Statistics Exercises

This document provides instructions for 4 exercises to practice data manipulation in R using CSV data files. Exercise 1 has students filter the bankloan data according to different criteria like marital status and education level. Exercise 2 has students recode variables in the bankloan data. Exercise 3 has students sort the bankloan data frame by different variables. Exercise 4 has students average variables to create a new variable using the brand data. The document concludes by advertising more advanced R courses.

Uploaded by

Gaurav Singh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
36 views2 pages

Beginner R Statistics Exercises

This document provides instructions for 4 exercises to practice data manipulation in R using CSV data files. Exercise 1 has students filter the bankloan data according to different criteria like marital status and education level. Exercise 2 has students recode variables in the bankloan data. Exercise 3 has students sort the bankloan data frame by different variables. Exercise 4 has students average variables to create a new variable using the brand data. The document concludes by advertising more advanced R courses.

Uploaded by

Gaurav Singh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Statistics with R – Beginner Level

Practice

Note: If you did not do it already, please download the CSV data files and extract them
on your hard drive. You can find the download link in the section Course Materials.

Section 1

Data Manipulation in R

Exercise #1

Using the file [Link], filter the data according to the conditions
below, using brackets, the subset command and the Dplyr package.

a. married subjects only


b. married subjects with secondary and tertiary education level
c. subjects over 40
d. single subjects under 35
e. subjects who have a loan and a balance over 1000

Exercise #2

Using the file [Link]:

a. recode the variable marital as follows: married – 1, single – 0


b. recode the variable loan as follows: yes – 1, no – 0
c. recode the variable balance as follows: under 500 – 1, between
501 and 1000 – 2, over 1000 – 3.
Exercise #3

Sort the data frame bankloan:

a. by age, ascending
b. by balance, descending
c. by age descending and by balance ascending

Exercise #4

In the data file [Link], create a new variable by averaging the following
variables: quality, problems and ads.

Learn more complex analysis techniques in R (click for a big


discount!)

Take the intermediate course

Become an expert in statistical analysis with R (click for a big


discount!)

Take the advanced course

You might also like