Site hosted by Angelfire.com: Build your free website today!

Homework 1

Linear Regression

 

The data for this problem illustrate the relationship between the average monthly outdoor temperature (in degrees Fahrenheit) and the average monthly gas consumption (in therms) for a household.  Use the attached SAS output to answer the following questions.

 

  1. Based on the first scatterplot, does it appear that it would be appropriate to fit a linear regression model to these data?  Why or why not?

 

  1. A regression model was fit to these data using SAS.  Use the output from PROC REG to write down the prediction equation for this regression model.

 

  1. What is the value of the slope for the model?  What does the slope tell you about the relationship between average temperature and average gas consumption?

 

  1. Using information from the SAS output and table A.3 in Steele & Torrie, construct a 95% confidence interval for the slope.  How do you interpret this confidence interval in non-statistical terms?

 

  1. Does it appear that there is a significant linear relationship between average temperature and average gas consumption?  Use the SAS output to conduct a hypothesis test to support your answer.   Be sure to state the hypotheses and report the t-statistic and p-value for your test.

 

  1. Assuming that this model is correct, how much gas should we expect to use, on average, in a month when the average temperature was 45 degrees Fahrenheit?

 

  1. Would it be appropriate to use this model to predict the average gas usage for a month when the average temperature was 85 degrees?  Why or why not?

 

  1. Report the coefficient of determination (R2) for this model and explain (in non-statistical terms) what it tells you about the relationship between average temperature and average gas consumption.

 

  1. Examine the plot of residuals vs. predicted values and residuals vs. time.  Does it appear that any of our assumptions have been violated or that there is need for further investigation before accepting this as our final regression model?  Explain.

 


 

                                          The SAS System         13:35 Monday, January 20, 2003   9

 

                     Plot of avgas*avtemp.  Legend: A = 1 obs, B = 2 obs, etc.

 

   12 ˆ

               A            A

     

     

     

                 A

     

   10 ˆ

                          A

             A

     

             A

     

     

    8 ˆ                      A

     

                               A               A

avgas

     

     

     

    6 ˆ

                                            A

     

                                 A

      

     

     

    4 ˆ

     

                                                                A

                                                              A

     

     

     

    2 ˆ                                                  A

      

                                                                                   A

     

                                                                                         A

     

     

    0 ˆ

      Šˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒ

      25       30       35       40       45       50       55       60       65       70       75

 

                                                  avtemp


                                        The SAS System         13:35 Monday, January 20, 2003   8

 

                                  Obs    time    avtemp    avgas

                                    1      0      29        8.9

                                    2      1      30       11.6

                                    3      2      31       10.7

                                    4      3      37       11.6

                                    5      4      48        7.5

                                    6      5      57        3.5

                                    7      6      68        1.5

                                    8      8      71        0.8

                                    9     10      53        1.9

                                   10     11      40        5.0

                                   11     12      39        7.3

                                   12     13      29        9.3

                                   13     14      36        9.7

                                   14     15      37        7.9

                                   15     16      46        5.8

                                   16     17      56        3.2

 

 

              

                                        The CORR Procedure

 

                                 2  Variables:    avgas    avtemp

 

                             Pearson Correlation Coefficients, N = 16

                                    Prob > |r| under H0: Rho=0

 

                                               avgas        avtemp

 

                                avgas        1.00000      -0.90300                                                          

                                avtemp      -0.90300       1.00000

 

 

                                         The REG Procedure

                                           Model: MODEL1

                                    Dependent Variable: avgas

 

                                       Analysis of Variance

 

                                              Sum of           Mean

          Source                   DF        Squares         Square    F Value    Pr > F

 

          Model                     1      161.51498      161.51498      61.85    <.0001

          Error                    14       36.56252        2.61161

          Corrected Total          15      198.07750

 

 

                       Root MSE              1.61605    R-Square     0.8154

                       Dependent Mean        6.63750    Adj R-Sq     0.8022

                       Coeff Var            24.34723

 

 

                                       Parameter Estimates

 

                                    Parameter       Standard

               Variable     DF       Estimate          Error    t Value    Pr > |t|

 

               Intercept     1       17.37277        1.42362      12.20      <.0001

               avtemp        1       -0.24295        0.03089      -7.86      <.0001


 

                                          The SAS System         13:35 Monday, January 20, 2003  12

 

                       Plot of res*pred.  Legend: A = 1 obs, B = 2 obs, etc.

 

        4 ˆ

         

         

         

         

                                                                  A

        3 ˆ

         

         

         

         

         

        2 ˆ

                                                 A

          

                                                                              A

         

     R   

     e  1 ˆ                                                          A

     s                                                                      A

     i       A    A

     d   

     u   

     a   

     l  0 ˆ                         A

         

                                                    A

                                    A                             A

                                                               A

         

       -1 ˆ                                                                     A

         

         

                                                                               A

          

         

       -2 ˆ

         

         

         

                                         A                    A

         

       -3 ˆ

          Šƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒ

             0            2            4            6            8           10           12

 

                                        Predicted Value of avgas


Plot of res*time.  Legend: A = 1 obs, B = 2 obs, etc.

 

    4 ˆ

     

     

     

     

                      A

    3 ˆ

     

     

     

     

     

    2 ˆ

                            A

     

             A

     

 R   

 e  1 ˆ                                                                        A

 s                A

 i                                    A         A

 d   

 u   

 a   

 l  0 ˆ                           A

     

                                                                                        A

                                                                                   A         A

                                                                    A

     

   -1 ˆ                                                                   A

     

     

        A

     

     

   -2 ˆ

     

     

     

                                                          A    A

     

   -3 ˆ

      Šƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒƒƒˆƒƒ

         0    1    2    3    4    5    6    7    8    9   10   11   12   13   14   15   16   17

 

                                                  time