(1.) Please begin from Question (1.).
Do not skip.
(2.) Two types of solutions will be given for Question (1.)
The rest of the questions will be done using one type of solution.
(3.) These steps and solutions are for Statistics students.
There are more detailed steps and solutions that I could use for Data Science and Computer Science students.
(1.) The table provided below shows paired data for the heights of a certain country's presidents and their main opponents
in the election campaign.
(a.) Construct a scatterplot.
(b.) Does there appear to be a correlation between the president's height and his opponent's height?
A. Yes, there appears to be a correlation. As the president's height increases, his opponent's height decreases.
B. Yes, there appears to be a correlation. As the president's height increases, his opponent's height increases.
C. Yes, there appears to be a correlation. The candidate with the highest height usually wins.
D. No, there does not appear to be a correlation because there is no general pattern to the data.
plotfunction with only one argument
xlim = c(160, 200) ylim = c(160, 200)where:
xlimis the limit for the x-axis. This includes the minimum value and the maximum value for the x-axis
ylimis the limit for the y-axis. This includes the minimum value and the maximum value for the y-axis
cis the function that selects and combines the values into a list. It is used when we need to pass a list (in this case: the values in both axis) as a parameter.
pch = 16where:
pchis the Plot Character
pch= 16 is the value of the plot character for filled circle
xlab = "President's height" ylab = "Opponent's height"(6.) 2nd Solution: Let us use more arguments (the ones we just listed) with the
plot(PresidentHeightVersusOpponentHeight, xlab = "President's height", ylab = "Opponent's height", xlim = c(160, 200), ylim = c(160, 200), pch = 16)
(2.) The table lists weights (pounds) and highway mileage amounts (mpg) for seven automobiles.
plot(WeightVersusHighway, xlab = "Weight (lb)", ylab = "Highway (mpg)", xlim = c(2000, 5000), ylim = c(20, 40), pch = 16)
(3.) This data is from a study comparing the amount of tar and carbon monoxide (CO) in cigarettes.
Use tar for the horizontal scale and use carbon monoxide (CO) for the vertical scale.
(a.) Construct a scatterplot.
(b.) Is there a relationship between cigarette tar and CO?
A. Yes, as the amount of tar increases the amount of carbon monoxide decreases.
B. Yes, as the amount of tar increases the amount of carbon monoxide also increases.
C. No, there appears to be no relationship.
plot(TarVersusCO, xlab = "Tar", ylab = "CO", xlim = c(0, 20), ylim = c(0, 20), pch = 15)
Plot Character is the argument that sets the characters/points in a plot.
It is denoted by
It has numeric values that shows several symbols used to represent the points in a plot.
|2||Triangle: Vertex up||
|6||Triangle: Vertex down||
|7||Cross inside Square (Square Cross)||
|9||Plus inside Diamond (Diamond Plus)||
|10||Plus inside Circle (Circle Plus)||
|11||Two Triangles: Vertex up and down||
|12||Plus inside Square (Square Plus)||
|13||Cross inside Circle (Circle Cross)||
|14||Triangle: Vertex up inside Square||
|17||Filled/Shaded Triangle: Vertex up||
|20||Small Shaded Circle||
|24||Triangle: Vertex up||
|25||Triangle: Vertex down||