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 year. Plot 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 uncorrelated? Explain 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
Step: 1
1 box plot C i...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started