Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit



MAT 215 Fall 2021

Final Project

 

The last graded assignment is either a final project or a final exam (your choice). This is the instruction for the project.

You can choose your own dataset for the project, but if you have trouble choosing an appropriate one, I suggest using the diamonds dataset that comes with R. If you type ?diamonds you should get some information about the variables. The weight of the diamond is measured in carats (1 carat is 200 miligrams). Note that one of the variables, depth, is defined in terms of three of the other variables.

If you choose your own dataset, it should be comparable to the diamonds dataset. That is, it should have several quantitative explanatory variables (at least two) and several categorical explanatory variables (at least two). The response variable should be quantitative.

The main focus of this project is find a way to estimate/predict the price of a diamond based on its phyical characteristics. (If you use your own dataset, make the appropriate adjustments.) But along the way you might want to look at other models. So be prepared to use other variables besides price as your response variable.

The final exam is scheduled for Friday, Dec 17, from 7 to 10 pm. So this project is due Friday, Dec 17, at 10 pm. Let me know if you need more time.

You should follow the directions below. Make the appropriate adjustments if you choose your own dataset.

1.  (5 points) Make sure your report looks good. That means resizing your plots if necessary, and using informative labels. Avoid including output that is not relevant or is too long. Use color to enliven your report.  Don’t forget to include text to explain what you are doing. Never begin a section with a plot or calculation; you should always have some text introducing what you are about to do.

2.  (10 points) Explore the variables individually. Calculate their means, medians, IQR, max, min, and so on.  Plot the variables, using bar charts or histograms as appropriate.  Do NOT include everything you do in the report, just the interesting ones. Since price is a big focus for us, you should certainly include what you find out about price (how is price distributed: symmetric, skew right, skew left? what is the price of the cheapest and most expensive diamonds?). You should also include results about some of the other variables (but not all!), especially if those variables contain interesting values such as outliers or possible mistakes in the data. Look carefully; sometimes you spot something when answering later questions, in which case you should go back and put what you found here.

3.  (5 points) Make a scatterplot of price vs carat. Do you see a linear relation? Or a curve? In this case, the plot suggests that you make a transformation of the data.  Check out some possible transformations: use log(price), for example.  Which transformation looks most linear to your eye? (This is subjective.) You might want to look at residuals in order to help make a determination. Remember that you do want residuals to be scattered randomly—you do not want to see a pattern.        (Note: log here is logarithm base e, not base 10.)

4.  (10 points) You expect big diamonds to be more expensive than small diamonds. There are several ways to measure the size of a diamond, but let’s look at two that are available in the data: its weight (in carats) and its volume. The data does not show the volume directly, but it does show length (x), width (y), and depth (z), so these three measures give a good indication of the volume of the diamond. Investigate which factor seems to be more important to the price of a diamond: its weight or its volume. You should of course look at R2, but consider also the precision of model coefficients and other factors. Remember to use the transformed variable in point (3).

5.  (10 points) These diamonds are all “round cut”, so their shapes are approximately the same (although their sizes are different). So their physical size, hence their volume, can probably be well approximated by just one of x, y, and z. Is this true? Use an ANOVA table to check this out. (How?) You can also check this out without using ANOVA. How?

6.  (10 points) A good model for price should take many factors into account, not just weight or volume. With that in mind, let’s take a look at color and clarity. For diamonds, the best color is called D and the worst is called J. For clarity, the best is IF and the worst is I1. Make boxplots of log(price) against color, and also boxplots of log(price) against clarity. What do you see? Does it seem strange? What is the explanation? Show that the explanation is reasonable and consistent with the data.

7.  (10 points) Construct a model for predicting the price of a diamond based on its size and other factors (cut, clarity, color). Use only the most relevant factors, so don’t include everything if the summary or ANOVA indicates that the variable is not important. Explain how you end up with the model that you do. Use your model to predict the price of a 0.4 carat diamond with I1 clarity, E color, premium cut, 4.3 mm length, 4.3 mm width, and 2.3 mm depth. How confident are you in your predicted price?

8.  (10 points) Unleash your creativity. Formulate an issue or a question related to this data set and try to answer/resolve/illustrate it by building a model whose response variable is not price. You might want to illustrate Simpson’s paradox, for example. Or you might want to investigate whether there is any relation between the color and the clarity of diamonds, since they seem to be inherent properties of the diamond itself (as opposed to the cut, which is created by the jeweler). Or you might want to use this data set to illustrate how order matters when doing ANOVA. Lots of possibilities here. Choose something interesting and explain what you are doing.

A final note: I’ve given this assignment before, so you might be able to find versions of the answers somewhere. The diamonds dataset comes with R, so there are analyses of this dataset online somewhere. Please do not look at these resources. You should only use the material that we generated during the semester (and the textbook too, of course).