Stat 798C Homework Set 5, Due Monday April 14, 2003. (1) Do the following exercise BOTH in SAS and Splus. Give the code and output for each. /****************************************************************/ /* E X E R C I S E */ /* */ /* FOR THE DATA BELOW, GIVING UNITS SOLD AND AMOUNTS */ /* SOLD FOR EACH OF SEVERAL SALES REPRESENTATIVES IN */ /* EACH MONTH OF A YEAR, COMPUTE THE FOLLOWING: */ /* 1) AVERAGE AMOUNT SOLD BY EACH REP, BY MONTH */ /* 2) AVERAGE AMOUNT SOLD, BY QUARTER */ /* 3) TOTAL UNITS SOLD, BY PRICE AND TYPE */ /* 4) PRINT OUT THE DATA FOR SALES OF "DELUXE" */ /* UNITS, SORTED BY MONTH AND REPRESENTATIVE. */ /* YOUR PRINTOUTS SHOULD BE TITLED APPROPRIATELY! */ /* /****************************************************************/ data allyear; input mth $ qtr $ salesrep $14. type $ units price; amtsold=units*price; cards; 01 1 Hollingsworth Deluxe 260 29.50 01 1 Smith Standard 41 19.95 01 1 Hollingsworth Standard 330 19.95 01 1 Jones Standard 110 19.95 01 1 Smith Deluxe 715 29.50 01 1 Jones Standard 675 19.95 02 1 Smith Standard 2045 19.95 02 1 Smith Deluxe 10 29.50 02 1 Smith Standard 40 19.95 02 1 Hollingsworth Standard 1030 19.95 02 1 Jones Standard 153 19.95 02 1 Smith Standard 98 19.95 03 1 Hollingsworth Standard 125 19.95 03 1 Jones Standard 154 19.95 03 1 Smith Standard 118 19.95 03 1 Hollingsworth Standard 25 19.95 03 1 Jones Standard 525 19.95 03 1 Smith Standard 310 19.95 04 2 Smith Standard 150 19.95 04 2 Hollingsworth Standard 260 19.95 04 2 Hollingsworth Standard 530 19.95 04 2 Jones Standard 1110 19.95 04 2 Smith Standard 1715 19.95 04 2 Jones Standard 675 19.95 05 2 Jones Standard 45 19.95 05 2 Hollingsworth Standard 1120 19.95 05 2 Smith Standard 40 19.95 05 2 Hollingsworth Standard 1030 19.95 05 2 Jones Standard 153 19.95 05 2 Smith Standard 98 19.95 06 2 Jones Standard 154 19.95 06 2 Hollingsworth Deluxe 25 29.50 06 2 Jones Standard 276 19.95 06 2 Hollingsworth Standard 125 19.95 06 2 Smith Standard 512 19.95 06 2 Smith Standard 1000 19.95 07 3 Smith Standard 250 19.95 07 3 Hollingsworth Deluxe 60 29.50 07 3 Smith Standard 90 19.95 07 3 Hollingsworth Deluxe 30 29.50 07 3 Jones Standard 110 19.95 07 3 Smith Standard 90 19.95 07 3 Hollingsworth Standard 130 19.95 07 3 Jones Standard 110 19.95 07 3 Smith Standard 265 19.95 07 3 Jones Standard 275 19.95 07 3 Smith Standard 1250 19.95 07 3 Hollingsworth Deluxe 60 29.50 07 3 Smith Standard 90 19.95 07 3 Jones Standard 110 19.95 07 3 Smith Standard 90 19.95 07 3 Hollingsworth Standard 330 19.95 07 3 Jones Standard 110 19.95 07 3 Smith Standard 465 19.95 07 3 Jones Standard 675 19.95 08 3 Jones Standard 145 19.95 08 3 Smith Deluxe 110 29.50 08 3 Hollingsworth Standard 120 19.95 08 3 Hollingsworth Standard 230 19.95 08 3 Jones Standard 453 19.95 08 3 Smith Standard 240 19.95 08 3 Hollingsworth Standard 230 29.50 08 3 Jones Standard 453 19.95 08 3 Smith Standard 198 19.95 08 3 Hollingsworth Standard 290 19.95 08 3 Smith Standard 1198 19.95 08 3 Jones Deluxe 45 29.50 08 3 Jones Standard 145 19.95 08 3 Smith Deluxe 110 29.50 08 3 Hollingsworth Standard 330 19.95 08 3 Smith Standard 240 19.95 08 3 Hollingsworth Deluxe 50 29.50 08 3 Jones Standard 453 19.95 08 3 Smith Standard 198 19.95 08 3 Jones Deluxe 225 29.50 09 3 Hollingsworth Standard 125 19.95 09 3 Jones Standard 254 19.95 09 3 Smith Standard 118 19.95 09 3 Hollingsworth Standard 1000 19.95 09 3 Jones Standard 284 19.95 09 3 Smith Standard 412 19.95 09 3 Jones Deluxe 275 29.50 09 3 Smith Standard 100 19.95 09 3 Jones Standard 876 19.95 09 3 Hollingsworth Standard 125 19.95 09 3 Jones Standard 254 19.95 09 3 Smith Standard 1118 19.95 09 3 Hollingsworth Standard 175 19.95 09 3 Jones Standard 284 19.95 09 3 Smith Standard 412 19.95 09 3 Jones Deluxe 275 29.50 09 3 Smith Standard 100 19.95 09 3 Jones Standard 876 19.95 10 4 Smith Standard 250 19.95 10 4 Hollingsworth Standard 530 19.95 10 4 Jones Standard 975 19.95 10 4 Hollingsworth Standard 265 19.95 10 4 Jones Standard 55 19.95 10 4 Smith Standard 365 19.95 11 4 Hollingsworth Standard 1230 19.95 11 4 Jones Standard 453 19.95 11 4 Smith Standard 198 19.95 11 4 Jones Standard 70 19.95 11 4 Smith Standard 120 19.95 11 4 Hollingsworth Deluxe 150 29.50 12 4 Smith Standard 1000 19.95 12 4 Jones Standard 876 19.95 12 4 Hollingsworth Deluxe 125 29.50 12 4 Jones Standard 1254 19.95 12 4 Hollingsworth Standard 175 19.95 ; run; (2) Fit a linear regression, using Splus or SAS or both to the data forbes.gz which can be found on the web-page http://www.math.umd.edu/~evs/s430/Data/ The data set Forbes was obtained by a 19th century physicist who sought to provide tables that would allow altitude to be measured based on the boiling point of water. This is not as silly as it sounds, as in those days altimeters were large and sensitive barometers, while thermometers, though breakable, were small and robust, and much more easily hauled up remote mountains. The dataset consists of measurements of the boiling point of water in degrees Fahrenheit, and measurements of air pressure in inches of mercury. (a) Construct a scatterplot for the air pressure as a function of temperature. Run a regression on the observations and comment on evidence of outliers and non-linearity. (b) Knowing that, to a first approximation, pressure is proportional to k0 exp(beta*T) where T is temperature, make an appropriate transformation on pressure so that a linear model can be properly fit. Make a new scatterplot to confirm the linear pattern. (c) Remove the outlier, run a new regression, and make a scatterplot with regression line and a residual plot. (d) Use the fitted line to provide a 99% prediction interval for the transformed pressure at temperatures of 200.5 degrees and 150 degrees. Why is the second estimate not to be trusted? What further observations would you need to make in order to have any confidence in it?