- Details
- Parent Category: Programming Assignments' Solutions

# We Helped With This R Studio Programming Homework: Have A Similar One?

Category | Programming |
---|---|

Subject | R | R Studio |

Difficulty | Undergraduate |

Status | Solved |

More Info | R Homework Help |

## Assignment Description

**Homework #2 Exploratory Data Analysis / Due Feb 3**

** **

1. Residents of Kalamazoo were asked to rank the desirability of five neighborhoods: Milwood, Edison, Hillcrest, Stuart, and Winchell. You want to know many different ways can they be ranked, assuming no ties. In R, create a vector called Neighborhoods that is composed of the five neighborhood text string names. You can install and load the combinat package that has a function called permn() that will produce every ordering of the five neighborhoods. Run this function and note that it prints out every ordering. The indices inside double brackets [[100]] indicate the numbering of the permutation. If you just want to know how many different ways there are to rank these five neighborhoods, you can nest the permn() function inside the length() function

>length(permn(Neighborhoods)) to figure out how many permutations there are. Put this number on the answer sheet.

2. The monthly rainfall in centimeters during March in Chicken Finger, Arkansas for the last 40 years is:

0.1 | 2.2 | 0.2 | 20.9 | 0.7 | 6.2 | 5.3 | 8.0 | 31.2 | 10.7 |

12.7 | 24.6 | 38.1 | 6.1 | 3.2 | 23.2 | 14.8 | 29.1 | 1.7 | 12.4 |

12.4 | 12.6 | 128.0 | 69.6 | 17.6 | 14.1 | 3.8 | 5.8 | 0.3 | 8.6 |

53 | 6.6 | 42.9 | 13.5 | 24.5 | 2.7 | 6.7 | 14.2 | 29.3 | 13.1 |

These numbers are listed on Sheet 1 of HW2a.csv, which is in the GEOG 5670 Elearning module. Download this file in the course content and save it to a data frame called ArkRainfall using the read.csv() function.

a. Use the summary() function to generate summary statistics for this data. Copy and paste the results to the answer sheet.

b. Construct a stem and leaf display for this data, using the stem() function. (To get R to display all the values of the stem, you’ll have to set the scale argument to 2. Copy and paste your result on the answer sheet.

c. Based on the stem and leaf plot, would you say the data distribution is skewed?

d. Use the boxplot() function to generate a boxplot of the rainfall data. Add an appropriate title and using the Export Data button copy and paste the plot onto the answer sheet.

e. Does the boxplot show any outliers?

f. Use the hist() function to create a histogram and paste this onto the answer sheet.

3. Detroit is divided into 60 police precincts. The number of burglaries in the last 12 months in each precinct is (these numbers are stored in a variable called Det Burg in HW2b.csv, which is in the Elearning module):

200 | 251 | 182 | 191 | 219 | 195 | 224 | 171 | 204 | 205 | 186 | 221 | 193 | 171 | 206 |

225 | 170 | 242 | 200 | 231 | 196 | 188 | 219 | 180 | 224 | 208 | 205 | 184 | 236 | 182 |

207 | 209 | 193 | 225 | 209 | 194 | 219 | 176 | 236 | 234 | 160 | 186 | 203 | 201 | 190 |

201 | 173 | 213 | 258 | 200 | 221 | 180 | 209 | 259 | 172 | 161 | 211 | 241 | 211 | 181 |

Download this file in the course content and save it to a data frame called Burglaries using the read.csv() function.

a. Use the summary() function to generate summary statistics for this data. Copy and paste the results to the answer sheet.

b. Construct a stem and leaf display for this data, using the stem() function. (In this case you can use the default scale setting of 1). Copy and paste your result on the answer sheet.

c. Based on the stem and leaf plot, would you say the data distribution is skewed?

d. Use the boxplot() function to generate a boxplot of the rainfall data. Add an appropriate title and using the Export Data button copy and paste the plot onto the answer sheet.

e. Does the boxplot show any outliers?

f. Use the hist() function to create a histogram and paste this onto the answer sheet.

GEOG5670HW2Answers.doc

**GEOG 5670 Spatial Analysis** Name
:

**Homework #2 Exploratory Data Analysis/Probability**

1. Total number of permutations of five neighborhood rankings: ________

2.

a. Summary statistics of rainfall:

b. Stem and leaf display:

c. Is the distribution skewed?

d. Boxplot of rainfall data:

e. Are there any outliers?

f. Histogram of rainfall data

3.

a. Summary statistics of Detroit burglaries

b. Stem and leaf display:

c. Is the distribution skewed?

d. Boxplot of burglaries data:

e. Are there any outliers?

f. Histogram of burglaries data