0% found this document useful (0 votes)
44 views

Descriptive and Graphical Analysis Using R

This document provides an overview of using R for data visualization. It discusses descriptive statistical analysis techniques like minimum, maximum, range, sum, median, variance and standard deviation. It then covers various graphical analysis techniques like histograms, box plots, bar charts, scatter plots, correlation matrices. The rest of the document demonstrates how to create these various plots in R like histograms, boxplots, scatter plots and bar plots using sample data. It also discusses other plots like heat maps and pie charts. Finally, it provides a practice assignment asking the reader to prepare some sample data and create a boxplot to interpret it.

Uploaded by

GUNA KALYAN
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

Descriptive and Graphical Analysis Using R

This document provides an overview of using R for data visualization. It discusses descriptive statistical analysis techniques like minimum, maximum, range, sum, median, variance and standard deviation. It then covers various graphical analysis techniques like histograms, box plots, bar charts, scatter plots, correlation matrices. The rest of the document demonstrates how to create these various plots in R like histograms, boxplots, scatter plots and bar plots using sample data. It also discusses other plots like heat maps and pie charts. Finally, it provides a practice assignment asking the reader to prepare some sample data and create a boxplot to interpret it.

Uploaded by

GUNA KALYAN
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 40

Data Visualization using R

Agenda
• Descriptive Analysis
– Min, Max, Range, Sum, Median, Var, Sd etc.
• Graphical Analysis
– Histogram, Box Plot, Bar Chart, Correlation Matrix,
Scatter Plots etc.
How many observations?
How many variables?

How many observations are there in a


variable?

3
Know More about Data
• min(grades$ethnicity)
• max(grades$ethnicity)
• range(grades$ethnicity)
• sum(grades$ethnicity)
• median(grades$ethnicity)
• var(grades$ethnicity)
• sd(grades$ethnicity)
Know structure of data

5
Top and Bottom 6 Data Points
• head(grades) for top 6 data points
• tail (grades) for bottom 6 data points
Summary of Data
• summary(grades)

• For further better understanding


– Install package (psych)
– Load package (psych)
– describe(grades)
Graphical Analysis

8
Scatter Plot
• A scatter plot (aka scatter chart, scatter graph) uses
dots to represent values for two different numeric
variables.
• The position of each dot on the horizontal and vertical
axis indicates values for an individual data point.
• Scatter plots’ primary uses are to observe and show
relationships between two numeric variables.
• Identification of correlational relationships are
common with scatter plots
10
11
12
Let’s Practice
• Create the scatterplot between BP and Age.
• Change the labels.
• Draw the regression line.
Histogram
• A histogram is a graphical representation of data
points organized into user-specified ranges.
• Similar in appearance to a bar graph, the
histogram condenses a data series into an easily
interpreted visual by taking many data points and
grouping them into logical ranges or bins.
• The horizontal axis displays the number range.
• The vertical axis (frequency) represents the
amount of data that is present in each range.
15
16
17
Let’s Practice
• Create the histogram of BP and Age from
CS2M file.
• Fill with heat color and topo colors.
• Change the labels.
Boxplot
• In its simplest form, the boxplot presents five sample
statistics - the minimum, the lower quartile, the median,
the upper quartile and the maximum - in a visual display.
• The box of the plot is a rectangle which encloses the
middle half of the sample, with an end at each quartile.
• The length of the box is thus the interquartile range of
the sample. The other dimension of the box does not
represent anything in particular.
• A line is drawn across the box at the sample median.
Boxplot
21
22
23
24
25
26
Task
• Prepare 100 observations related to discipline
of your choice for two variables (one
continuous and one categorical).
• Prepare the boxplot
• Interpret it.
Barplot
• A bar chart or bar graph is a chart or graph that presents
categorical data with rectangular bars with heights or lengths
proportional to the values that they represent.
• The bars can be plotted vertically or horizontally. A vertical
bar chart is sometimes called a column chart.
• A bar graph shows comparisons among discrete categories.
• One axis of the chart shows the specific categories being
compared, and the other axis represents a measured value.
• Some bar graphs present bars clustered in groups of more
than one, showing the values of more than one measured
variable.
Barplot
30
31
32
33
34
35
36
37
Heat Maps
• A heatmap displays a set of data using colored
tiles for each variable value within each
observation.
Pie Chart
prashant<- c(10, 20, 25, 30)
names(prashant)<-c("Jaipur", "Agra", "Jammu",
"Delhi")
pie(prashant) Agra

Jaipur

Jammu

Delhi
Practice Assignment

You might also like