Reference no: EM132385423
Stat 362-Monte Carlo Methods
Lab Assignment
Instructions: you should submit one file (either a .docx file or a .pdf file). The first part of the file should include your answers to the questions and any relevant output. After your solutions, please include all your code you wrote to answer the questions (separated by question). Please clearly label each answer.
1) The data set DinosaurBBQShrimp.txt posted on blackboard contains data on whether the Drunken Spicy Shrimp can be selected as part of Dinosaur Bar-B-Que's combo meals at each location. Each observation consists of the city, state, and a variable indicating whether shrimp is an option (with values of "Yes" if it is and "No" if it is not).
In addition, the DinosaurBBQRibs.txt (an organized version of last week's data set) is also posted on blackboard and contains data on the price of a quarter rack of ribs at 9 different Dinosaur Bar-B-Que locations. Each observation is made up of the restaurant's city, state, and price and it is a space delimited file.
a) Import both the DinosaurBBQShrimp.txt and the DinosaurBBQRibs.txt data sets into SAS as separate SAS data sets. Merge the SAS data sets into one and print your result. Provide a properly titled table in your solution.
b) Sort your merged SAS data set by price of a quarter rack of ribs, from cheapest to most expensive. Print the resulting table and present it (properly titled) in your solutions.
c) Create a data set consisting only of the Dinosaur BBQ locations in the state of New York. Print and present your properly titled table.
d) Read the two data sets into R. Merge them into a single data frame. Copy and paste the data frame after printing it in your console.
e) Sort your data frame by the price of a quarter rack of ribs, from most expensive to cheapest. Present your sorted data frame in your solutions.
f) Determine the mean price of a quarter rack of ribs across all Dinosaur BBQ locations.
g) Use the subset() function to create a data set consisting only of locations that serve shrimp as a combo meal option. Determine the mean price of a quarter rack of ribs at these locations. Report your results.
#2 on the next page.
2) Using an organized version of the Mouse Weights data set from HW 2, complete the following.
a) Import the organized data set to SAS. Calculate the difference between the Day 21 weight and the Day 3 weight for each mouse. Present it as a new column in SAS and print only the mouse number and the weight difference.
b) Calculate the mean difference in weight and present your answer in your solutions.
c) Repeat part (a) in R.
d) Repeat part (b) in R.
Remember to present your code at the end of your solutions.
Attachment:- Lab Assignment.rar