# Exploratory Data Analysis Coursera Quiz Answer

Today we are going to share all week assessment and quizzes answers of Exploratory Data Analysis course launched by Coursera for totally free of cost. This is a certification course for every interested student.

This course covers the essential exploratory techniques for summarizing data. These techniques are typically applied before formal modeling commences and can help inform the development of more complex statistical models. Exploratory techniques are also important for eliminating or sharpening potential hypotheses about the world that can be addressed by the data. We will cover in detail the plotting systems in R as well as some of the basic principles of constructing data graphics. We will also cover some of the common multivariate statistical techniques used to visualize high-dimensional data. This course is part of multiple programs this course can be applied to multiple Specializations or Professional Certificates programs. Completing this course will count towards your learning in any of the following programs:

These answers are updated recently and are 100% correct answers of all week, assessment and final exam answers of Exploratory Data Analysis from Coursera Free Certification Course.

`Use “Ctrl+F” To Find Any Questions Answer. & For Mobile User, You Just Need To Click On Three dots In Your Browser & You Will Get A “Find” Option There. Use These Option to Get Any Random Questions Answer.`

Enroll Now – Exploratory Data Analysis

`Week 1 Quiz`

Question 1
Which of the following is a principle of analytic graphics?

• Show box plots (univariate summaries)
• Only do what your tools allow you to do
• Show causality, mechanism, explanation
• Make judicious use of color in your scatterplots
• Don’t plot more than two variables at at time

1.

Which of the following is a principle of analytic graphics?

• Make judicious use of color in your scatterplots (NO)
• Don’t plot more than two variables at at time (NO)
• Show box plots (univariate summaries) (NO)
• Only do what your tools allow you to do (NO)
• Show comparisons

Question 2
What is the role of exploratory graphs in data analysis?

• Axes, legends, and other details are clean and exactly detailed.
• They are typically made very quickly.
• Only a few are constructed.
• They are made for formal presentations.

Question 3
Which of the following is true about the base plotting system?

• The system is most useful for conditioning plots
• Plots are created and annotated with separate functions
• Plots are typically created with a single function call
• Margins and spacings are adjusted automatically depending on the type of plot and the data

Question 4
Which of the following is an example of a valid graphics device in R?

• The keyboard
• A file folder
• A Microsoft Word document
• A PNG file
• A socket connection

Which of the following is an example of a valid graphics device in R?

A file folder (NO)

The computer screen

A Microsoft Word document (NO)

A socket connection (NO)

The keyboard (NO)

Question 5
Which of the following is an example of a vector graphics device in R?

• TIFF
• GIF
• Postscript
• PNG
• JPEG

5.

Which of the following is an example of a vector graphics device in R?

• GIF
• TIFF
• SVG
• PNG
• JPEG

Question 6
Bitmapped file formats can be most useful for

• Scatterplots with many many points
• Plots that require animation or interactivity
• Plots that are not scaled to a specific resolution
• Plots that may need to be resized

Question 7
Which of the following functions is typically used to add elements to a plot in the base graphics system?

• hist()
• boxplot()
• plot()
• text()

Which of the following functions is typically used to add elements to a plot in the base graphics system?

hist()

plot()

points()

boxplot()

Question 8
Which function opens the screen graphics device for the Mac?

• quartz()
• bitmap()
• pdf()
• png()

8.

Which function opens the screen graphics device on Windows?

postscript()

windows()

jpeg()

xfig()

Question 9
What does the ‘pch’ option to par() control?

• the plotting symbol/character in the base graphics system
• the line width in the base graphics system
• the orientation of the axis labels on the plot
• the size of the plotting symbol in a scatterplot

9. What does the ‘pch’ option to par() control?

• the size of the plotting symbol in a scatterplot
• the plotting symbol/character in the base graphics system
• the orientation of the axis labels on the plot
• the line width in the base graphics system

Question 10
If I want to save a plot to a PDF file, which of the following is a correct way of doing that?

• Construct the plot on the screen device and then copy it to a PDF file with dev.copy2pdf()
• Construct the plot on the PNG device with png(), then copy it to a PDF with dev.copy2pdf().
• Open the screen device with quartz(), construct the plot, and then close the device with dev.off().
• Open the PostScript device with postscript(), construct the plot, then close the device with dev.off().

#### Week 1 Assignment :

https://github.com/a-tagliente/ExData_Plotting1

### Week– 2

Question 1
Under the lattice graphics system, what do the primary plotting functions like xyplot() and bwplot() return?

• an object of class “plot”
• an object of class “trellis”
• an object of class “lattice”
• nothing; only a plot is made

Question 2
What is produced by the following code?

123
library(nlme)
library(lattice)
xyplot(weight ~ Time | Diet, BodyWeight)
1 point

• A set of 16 panels showing the relationship between weight and time for each rat.
• A set of 11 panels showing the relationship between weight and diet for each time.
• A set of 3 panels showing the relationship between weight and time for each rat.
• A set of 3 panels showing the relationship between weight and time for each diet.

Question 3
Annotation of plots in any plotting system involves adding points, lines, or text to the plot, in addition to customizing axis labels or adding titles. Different plotting systems have different sets of functions for annotating plots in this way.

Which of the following functions can be used to annotate the panels in a multi-panel lattice plot?

• panel.lmline()
• lines()
• points()
• axis()

3. Annotation of plots in any plotting system involves adding points, lines, or text to the plot, in addition to customizing axis labels or adding titles. Different plotting systems have different sets of functions for annotating plots in this way.

Which of the following functions can be used to annotate the panels in a multi-panel lattice plot?

• axis()
• text()
• panel.abline()
• points()
• lines()

Question 4
The following code does NOT result in a plot appearing on the screen device.

1234
library(lattice)
library(datasets)
data(airquality)
p <- xyplot(Ozone ~ Wind | factor(Month), data = airquality)
Which of the following is an explanation for why no plot appears?

• The object ‘p’ has not yet been printed with the appropriate print method.
• There is a syntax error in the call to xyplot().
• The xyplot() function, by default, sends plots to the PDF device.

Question 5
In the lattice system, which of the following functions can be used to finely control the appearance of all lattice plots?

• trellis.par.set()
• splom()
• par()
• print.trellis()

Question 6
What is ggplot2 an implementation of?

• a 3D visualization system
• the S language originally developed by Bell Labs
• the base plotting system in R
• the Grammar of Graphics developed by Leland Wilkinson

Question 7
Load the `airquality’ dataset form the datasets package in R

12
library(datasets)
data(airquality)
I am interested in examining how the relationship between ozone and wind speed varies across each month. What would be the appropriate code to visualize that using ggplot2?

• 1
qplot(Wind, Ozone, data = airquality, facets = . ~ factor(Month))
• 1
qplot(Wind, Ozone, data = airquality)
• 12
airquality = transform(airquality, Month = factor(Month))
qplot(Wind, Ozone, data = airquality, facets = . ~ Month)
• 1
qplot(Wind, Ozone, data = airquality, geom = “smooth”)

Question 8
What is a geom in the ggplot2 system?

• a method for mapping data to attributes like color and size
• a statistical transformation
• a method for making conditioning plots
• a plotting object like point, line, or other shape

Question 9
When I run the following code I get an error:

1234
library(ggplot2)
library(ggplot2movies)
print(g)
I was expecting a scatterplot of ‘votes’ and ‘rating’ to appear. What’s the problem?

• The object ‘g’ does not have a print method.
• The dataset is too large and hence cannot be plotted to the screen.
• There is a syntax error in the call to ggplot.
• ggplot does not yet know what type of layer to add to the plot.

10.
Question 10
The following code creates a scatterplot of ‘votes’ and ‘rating’ from the movies dataset in the ggplot2 package. After loading the ggplot2 package with the library() function, I can run

1
How can I modify the the code above to add a smoother to the scatterplot?

qplot(votes, rating, data = movies) + geom_smooth()

### Week- 4

#### Peer-graded Assignment: Course Project 2

1.

PROMPT
Copy and paste the R code file for the plot uploaded in the previous question.

# libraries
require(utils)
require(cairoDevice) # anti-aliasing figure
fileUrl <-
‘https://d396qusza40orc.cloudfront.net/exdata%2Fdata
%2FNEI_data.zip’
destfile = ‘./Data.zip’,
method = ‘curl’, quiet = T)
if(file.exists(‘./Data.zip’)) {
# Extract data file
unzip(‘./Data.zip’)
# Delete original Zip file if it exists
invisible(file.remove(‘./Data.zip’))
}

## This first line will likely take a few seconds. Be
patient!
# Delete data files .rds
if(all(file.exists(‘./summarySCC_PM25.rds’,
‘Source_Classification_Code.rds’))) {
invisible(file.remove(‘./summarySCC_PM25.rds’,
‘Source_Classification_Code.rds’))
}

# Create the png
png(‘./plot1.png’, width = 500, height = 450,
res = 55, type = ‘cairo’) # default is 480px X 480px
# Make Plot
with(aggregate(Emissions ~ year, NEI, sum),
plot(Emissions~year, pch = 18,
xlab = ”, ylab = ‘Total PM2.5 Emissions (tons)’,
main = ‘Total PM2.5 Emissions by Year’,
col = “blue”, type = “b”, xlim = c(1999, 2008),
lty = 2, lwd = 1.5, lab = c(10, 5, 7)))
# Close png file
dev.off()

2.

PROMPT

Copy and paste the R code file for the plot uploaded in the previous question.

# libraries
require(utils)
require(cairoDevice) # anti-aliasing figure
fileUrl <-
‘https://d396qusza40orc.cloudfront.net/exdata%2Fdata
%2FNEI_data.zip’
destfile = ‘./Data.zip’,
method = ‘curl’, quiet = T)
if(file.exists(‘./Data.zip’)) {
# Extract data file
unzip(‘./Data.zip’)
# Delete original Zip file if it exists
invisible(file.remove(‘./Data.zip’))
}

## This first line will likely take a few seconds. Be
patient!
# Delete data files .rds
if(all(file.exists(‘./summarySCC_PM25.rds’,
‘Source_Classification_Code.rds’))) {
invisible(file.remove(‘./summarySCC_PM25.rds’,
‘Source_Classification_Code.rds’))) {
invisible(file.remove(‘./summarySCC_PM25.rds’,
‘Source_Classification_Code.rds’))
}

# Create the png
png(‘./plot2.png’, width = 500, height = 450,
res = 55, type = ‘cairo’) # default is 480px X 480px
# subset data
NEI_Baltimore <- subset(NEI, fips == “24510”)
# Make Plot
with(aggregate(Emissions ~ year, NEI_Baltimore, sum),
plot(Emissions~year, pch = 18,
xlab = ”, ylab = ‘Total PM2.5 Emissions (tons)’,
main = ‘Total PM2.5 Emissions by Year in Baltimore City’,
col = “blue”, type = “b”, xlim = c(1999, 2008),
lty = 2, lwd = 1.5, lab = c(10, 5, 7)))
# Close png file
dev.off()

3.

PROMPT

Copy and paste the R code file for the plot uploaded in the previous question.

# libraries
require(utils)
require(cairoDevice) # anti-aliasing figure
fileUrl <-
‘https://d396qusza40orc.cloudfront.net/exdata%2Fdata
%2FNEI_data.zip’
destfile = ‘./Data.zip’,
method = ‘curl’, quiet = T)
if(file.exists(‘./Data.zip’)) {
# Extract data file
unzip(‘./Data.zip’)
# Delete original Zip file if it exists
invisible(file.remove(‘./Data.zip’))
}
## This first line will likely take a few seconds. Be
patient!
# Delete data files .rds
if(all(file.exists(‘./summarySCC_PM25.rds’,
‘Source_Classification_Code.rds’))) {
invisible(file.remove(‘./summarySCC_PM25.rds’,
‘Source_Classification_Code.rds’))
}

# Create the png
png(‘./plot3.png’, width = 700, height = 370,
res = 75, type = ‘cairo’) # default is 480px X 480px
# subset data
NEI_Baltimore <- subset(NEI, fips == “24510”)
# Make Plot
NEI_Baltimore %>%
group_by(year, type) %>%
summarise(sum = sum(Emissions)) %>%
ggplot(aes(year, sum)) +
geom_point() + geom_line() +
facet_wrap(~type, ncol = 4) +
labs(title = ‘Total PM2.5 Emission by Year in Baltimore
City’,
subtitle = ‘Subsetted by Type of Source’) +
xlab(”) + ylab(‘Total PM2.5 Emission (tons)’) +
scale_x_continuous(breaks =
unique(NEI_Baltimore\$year)) +
theme_bw()
# Close png file
dev.off()

4.

PROMPT

Copy and paste the R code file for the plot uploaded in the previous question.

# libraries
require(utils)
require(cairoDevice) # anti-aliasing figure
fileUrl <-
‘https://d396qusza40orc.cloudfront.net/exdata%2Fdata
%2FNEI_data.zip’
destfile = ‘./Data.zip’,
method = ‘curl’, quiet = T)
if(file.exists(‘./Data.zip’)) {
# Extract data file
unzip(‘./Data.zip’)
# Delete original Zip file if it exists
invisible(file.remove(‘./Data.zip’))
}

## This first line will likely take a few seconds. Be
patient!
# Delete data files .rds
if(all(file.exists(‘./summarySCC_PM25.rds’,
‘Source_Classification_Code.rds’))) {
invisible(file.remove(‘./summarySCC_PM25.rds’,
‘Source_Classification_Code.rds’))) {
invisible(file.remove(‘./summarySCC_PM25.rds’,
‘Source_Classification_Code.rds’))
}

# Create the png
png(‘./plot4.png’, width = 700, height = 370,
res = 75, type = ‘cairo’) # default is 480px X 480px
# merge data and make Plot
NEI %>%
inner_join(SCC, by = ‘SCC’) %>%
dplyr::filter(str_detect(Short.Name, ‘[Cc]oal’)) %>%
group_by(year, type) %>%
summarise(sum = sum(Emissions)) %>%
ggplot(aes(year, sum)) +
geom_point() + geom_line() +
facet_wrap(~type, ncol = 4) +
labs(title = ‘Total PM2.5 Coal Emission by Year’,
subtitle = ‘Subsetted by Type of Source’) +
xlab(”) + ylab(‘Total PM2.5 Emission (tons)’) +
scale_x_continuous(breaks = unique(NEI\$year)) +
theme_bw()
# Close png file
dev.off()

5.

PROMPT
Copy and paste the R code file for the plot uploaded in the previous question.

# libraries
require(utils)
require(cairoDevice) # anti-aliasing figure
fileUrl <-
‘https://d396qusza40orc.cloudfront.net/exdata%2Fdata
%2FNEI_data.zip’
destfile = ‘./Data.zip’,
method = ‘curl’, quiet = T)
if(file.exists(‘./Data.zip’)) {
# Extract data file
unzip(‘./Data.zip’)
# Delete original Zip file if it exists
invisible(file.remove(‘./Data.zip’))
}

## This first line will likely take a few seconds. Be
patient!
# Delete data files .rds
if(all(file.exists(‘./summarySCC_PM25.rds’,
‘Source_Classification_Code.rds’))) {
invisible(file.remove(‘./summarySCC_PM25.rds’,
‘Source_Classification_Code.rds’))
}

# Create the png
png(‘./plot5.png’, width = 700, height = 370,
res = 75, type = ‘cairo’) # default is 480px X 480px
# Make Plot
NEI %>%
dplyr::filter(fips == ‘24510’,
group_by(year) %>%
summarise(sum = sum(Emissions)) %>%
ggplot(aes(year, sum)) +
geom_point() + geom_line() +
labs(title = ‘Total PM2.5 Emission by Year in Baltimore
City’,
subtitle = ‘Subsetted from Motor Vehicle Sources (“On-
xlab(”) + ylab(‘Total PM2.5 Emission (tons)’) +
scale_x_continuous(breaks = unique(NEI\$year)) +
theme_bw()
# Close png file
dev.off()

6.

PROMPT
Copy and paste the R code file for the plot uploaded in the previous question.

# libraries
require(utils)
require(cairoDevice) # anti-aliasing figure
fileUrl <-
‘https://d396qusza40orc.cloudfront.net/exdata%2Fdata
%2FNEI_data.zip’
destfile = ‘./Data.zip’,
method = ‘curl’, quiet = T)
if(file.exists(‘./Data.zip’)) {
# Extract data file
unzip(‘./Data.zip’)
# Delete original Zip file if it exists
invisible(file.remove(‘./Data.zip’))
}

## This first line will likely take a few seconds. Be
patient!
# Delete data files .rds
if(all(file.exists(‘./summarySCC_PM25.rds’,
‘Source_Classification_Code.rds’))) {
invisible(file.remove(‘./summarySCC PM25.rds’
‘Source_Classification_Code.rds’))
}

# Create the png
png(‘./plot6.png’, width = 700, height = 370,
res = 75, type = ‘cairo’) # default is 480px X 480px
# Make Plot
NEI %>%
dplyr::filter(fips %in% c(“24510”, “06037”),
group_by(year, fips) %>%
summarise(sum = sum(Emissions)) %>%
ggplot(aes(year, sum, col = fips)) +
geom_point() + geom_line() +
labs(title = ‘Total PM2.5 Emission by Year in Baltimore
and Los Angeles’,
subtitle = ‘Subsetted from Motor Vehicle Sources (“On-
xlab(”) + ylab(‘Total PM2.5 Emission (tons)’) +
scale_colour_discrete(name = “City”, labels = c(“Los
Angeles”, “Baltimore”)) +
theme(legend.title = element_text(face = “bold”)) +
scale_x_continuous(breaks = unique(NEI\$year)) +
theme_bw()
# Close png file
dev.off()

## Conclution:

We hope you will do well in your Exploratory Data Analysis Coursera Quiz Answer by our article. If you think It helps you a little please share it with your friends. And Stay with queryfor.com for any kind of Exam or quiz Answer. We also provide Coursera Quiz answer, Coursehero free Unlock.