Question: Instructions: you first must install the Ecdat package with the command. What code did you use to answer the questions? install.packages(Ecdat) library(Ecdat) head(Cigarette) Questions 1.

Instructions: you first must install the Ecdat package with the command. What code did you use to answer the questions?

install.packages("Ecdat")

library(Ecdat)

head(Cigarette)

Questions

1. Create a boxplot of the average number of packs per capita by state. Which states have the highest number of packs? Which have the lowest?

2. Find the median over all the states of the number of packs per capita for each yearPlot this median value for the years from 1985 to 1995. What can you say about cigarette usage in these years?

3. Create a scatter plot of price per pack vs number of packs per capita for all states and years?

4. Are the price and the per capita packs positively correlated, negatively correlated, or uncorrelatedExplain why your answer would be expected?

5. Change your scatter plot to show the points for each year in a different color. Does the relationship between the two variable change over time?

How did you get the code for these questions?

Step by Step Solution

3.43 Rating (150 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

1 box plot C i... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Engineering Questions!