Question: In this project you will learn to create data visualizations in R , an open source software environment for statistics computing and graphics. For more

In this project you will learn to create data visualizations in R , an open source software environment for statistics computing and graphics. For more information on R, visit this page , which contains links to many R tutorials. R comes with its own GUI, but you may use other R GUIs such as RStudio . 1. You need to install the following data sets in R. Name Data Package Data set name in R Description of the data set

Visits to Physician Office

Ecdat OFP link

Education and Related Statistics for the US States

carData States link

US Car Price Data

DAAG carprice link

Data from GapMinder.org web site

gapminder gapminder link

To download a data set, you need to do the following in R: install.packages(DAAG) library(DAAG) OFP carprice 2. You need to use the package lattice. You also need to install the package ggplot2 3. (25 points) Use the basic R graphics functions to create the following charts: a. A bar chart showing the life expectancy for the United States over the years. (Data source: gapminder) b. A line chart showing the GDP of the United States over the years. (Data source: gapminder) c. A histogram showing MPG.city. (Data source: carprice)

d. A density plot showing Price. (Data source: carprice) e. (5 points) Every chart must have a main title. The X and Y axes must be properly labeled.

4. (20 points points) Use ggplot2 to create the following charts: a. A box plot showing the number of physician office visits, number of emergency room visits, number of hospitalizations, and number of chronic conditions. (Data source: OFP) b. A dot chart showing the most recent GDP for different countries. (Data source: gapminder) c. A scatter plot in which the vertical axis is the number of chronic condition, the horizontal axis is the family income, and the color is used to encode sex. (Data source: OFP) d. (5 points) In one of the above charts, you need to insert an arrow that points to a mark and an annotation text.

5. (15 points) Use lattice or ggplot2 to create one plot matrix that show the relationship between the following columns in the data set States: SATV, SATM, region, dollars, and pay. a. Write a brief analysis to explain the chart. For example, does the data shows a relationship between SAT score and dollars spent and/or teacher pay? b. You are free to select the chart type. But only create one plot. For example, you may use xyplot in lattice or ggcorrplot in ggplot2. However, all the five data columns above must present in your chart.

6. (25 points) Use lattice or ggplot2 to create one or more charts that show the relationship between the following columns: number of physician office visits, number of emergency room visits, number of hospitalizations, number of chronic conditions, age, sex, marriage, school, family income, employed, and region. a. Write a brief analysis to explain the charts. For example, does the data shows a relationship between number of chronic conditions and family income, employment, and/or marriage status? b. You are free to select the chart type. You can create more than one chart. But all the above 11 data columns must be included in at least one chart. 7. (15 points) Load a data set other than the ones listed in section 1. Create at least one data visualization that includes at least 3 data columns. a. For more data sets that you can download to R, visit https://vincentarelbundock.github.io/Rdatasets/datasets.html

8. Save each chart into a PDF file. First select the chart window, and then go to menu File -> Save as. Insert your charts into a MS Word file and under each chart indicate which requirement is this chart made for. For example, under a line

chart you can write Requirement 3.b, or Requirement 5. Describe the chart in more details if necessary. a. Without proper description, points may be deducted if my TA or myself cannot related a chart to a specific requirement.

9. Save the history of your work session into a text file. You can use the command savehistory(file = filename.txt) to save the history of your work session into a text file in your working directory. a. RStudio has a History window in which you can save your command history into a file.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!