# Assignment 1

This quick assignment considers the food texture data (introduced in class 2). There are 5 variables in the data table:

1. Oil: percentage oil in the pastry
2. Density: the product’s density (the higher the number, the more dense the product)
3. Crispy: a crispiness measurement, on a scale from 7 to 15, with 15 being more crispy.
4. Fracture: the angle, in degrees, through which the pasty can be slowly bent before it fractures.
5. Hardness: a sharp point is used to measure the amount of force required before breakage occurs.

1. Calculate the mean centering vector (a $$1 \times 5$$ vector).
2. Calculate the scaling vector (a $$1 \times 5$$ vector) and indicate whether you multiply or divide columns in $$\mathbf{X}$$ by the corresponding entries in your vector.
3. Draw a scatter plot for Oil vs Density using all 50 data points from the raw data table.
4. Draw a scatter plot for Oil vs Density after you have centered and scaled the data. Any observations when you compare it to the previous scatter plot?
5. Use the software to calculate PCA model and report the $$R^2$$ value for the first and second component. What is the total $$R^2$$ using 2 components?
6. Report the cumulative $$R^2$$ value for each of the 5 variables after adding (a) one component and (b) two components.
7. Write down the values of the $$p_1$$ loading vector.
8. What are the characteristics of pastries with large negative $$t_1$$ values?
10. Replicate the calculation for the $$t_1$$ value for pastry B758. Show each of the 5 terms that make up this linear combination.