6-1 Introduction To Empirical Models
Based on the scatter diagram, it is probably reasonable to assume that the mean of the random variable Y is related to x by the following straight-line relationship: where the slope and intercept of the line are called regression coefficients. The simple linear regression model is given by where is the random error term.
6-1 Introduction To Empirical Models
We think of the regression model as an empirical model. Suppose that the mean and variance of are 0 and 2, respectively, then The variance of Y given x is 6-1 Introduction To Empirical Models
The true regression model is a line of mean values: where 1 can be interpreted as the change in the mean of Y for a unit change in x. Also, the variability of Y at a particular value of x is determined by the error variance, 2. This implies there is a distribution of Y-values at each x and that the variance of this distribution is the same at each x. 6-1 Introduction To Empirical Models
A Multiple Linear Regression Model:
6-2 Simple Linear Regression Least Squares Estimation The case of simple linear regression considers a single regressor or predictor x and a dependent or response variable Y. The expected value of Y at each level of x is a random variable: We assume that each observation, Y, can be described by the model
6-2 Simple Linear Regression Least Squares Estimation Suppose that we have n pairs of observations (x 1, y 1 ), (x 2, y 2 ), …, (x n, y n ). The method of least squares is used to estimate the parameters, 0 and 1 by minimizing the sum of the squares of the vertical deviations in Figure 6-6.
6-2 Simple Linear Regression Least Squares Estimation Using Equation 6-8, t he n observations in the sample can be expressed as The sum of the squares of the deviations of the observations from the true regression line is
6-2 Simple Linear Regression Least Squares Estimation
6-2 Simple Linear Regression Least Squares Estimation
6-2 Simple Linear Regression Least Squares Estimation
6-2 Simple Linear Regression Least Squares Estimation
6-2 Simple Linear Regression Least Squares Estimation
6-2 Simple Linear Regression Least Squares Estimation
6-2 Simple Linear Regression Least Squares Estimation
6-2 Simple Linear Regression Least Squares Estimation
6-2 Simple Linear Regression Sums of Squares and Cross-products Matrix The Sums of squares and cross-products matrix is a convenient way to summarize the quantities needed to do the hand calculations in regression. It also plays a key role in the internal calculations of the computer. It is outputed from PROC REG and PROC GLM if the XPX option is included on the model statement. The elements are X’X InterceptXY n X Y
6-2 Simple Linear Regression Least Squares Estimation
6-2 Simple Linear Regression Regression Assumptions and Model Properties
6-2 Simple Linear Regression Regression Assumptions and Model Properties
6-2 Simple Linear Regression Regression and Analysis of Variance
6-2 Simple Linear Regression Regression and Analysis of Variance
6-2 Simple Linear Regression Testing Hypothesis in Simple Linear Regression Use of t-Tests Suppose we wish to test An appropriate test statistic would be
6-2 Simple Linear Regression Testing Hypothesis in Simple Linear Regression Use of t-Tests We would reject the null hypothesis if
6-2 Simple Linear Regression Testing Hypothesis in Simple Linear Regression Use of t-Tests Suppose we wish to test An appropriate test statistic would be
6-2 Simple Linear Regression Testing Hypothesis in Simple Linear Regression Use of t-Tests We would reject the null hypothesis if
6-2 Simple Linear Regression Testing Hypothesis in Simple Linear Regression Use of t-Tests An important special case of the hypotheses of Equation 6-23 is These hypotheses relate to the significance of regression. Failure to reject H 0 is equivalent to concluding that there is no linear relationship between x and Y.
6-2 Simple Linear Regression Testing Hypothesis in Simple Linear Regression Use of t-Tests
6-2 Simple Linear Regression Testing Hypothesis in Simple Linear Regression Use of t-Tests
6-2 Simple Linear Regression
The Analysis of Variance Approach
6-2 Simple Linear Regression Testing Hypothesis in Simple Linear Regression The Analysis of Variance Approach
6-2 Simple Linear Regression Confidence Intervals in Simple Linear Regression
6-2 Simple Linear Regression Confidence Intervals in Simple Linear Regression
6-2 Simple Linear Regression
6-2.4 Prediction of Future Observations
6-2 Simple Linear Regression
6-2.4 Prediction of Future Observations
6-2 Simple Linear Regression Checking Model Adequacy Fitting a regression model requires several assumptions. 1.Errors are uncorrelated random variables with mean zero; 2.Errors have constant variance; and, 3.Errors be normally distributed. The analyst should always consider the validity of these assumptions to be doubtful and conduct analyses to examine the adequacy of the model
6-2 Simple Linear Regression Checking Model Adequacy The residuals from a regression model are e i = y i - ŷ i, where y i is an actual observation and ŷ i is the corresponding fitted value from the regression model. Analysis of the residuals is frequently helpful in checking the assumption that the errors are approximately normally distributed with constant variance, and in determining whether additional terms in the model would be useful.
6-2 Simple Linear Regression Checking Model Adequacy
6-2 Simple Linear Regression Checking Model Adequacy
6-2 Simple Linear Regression Checking Model Adequacy
6-2 Simple Linear Regression Checking Model Adequacy
6-2 Simple Linear Regression Checking Model Adequacy
6-2 Simple Linear Regression Example 6-1 OPTIONS NOOVP NODATE NONUMBER LS=140; DATA ex61; INPUT salt area LABEL salt='Salt Conc' area='Roadway area'; CARDS; ods graphics on; PROC REG DATA=EX61; MODEL SALT=AREA/XPX R; DATA EX61N; AREA=1.25; OUTPUT; DATA EX61N1; SET EX61 EX61N; ods graphics off; PROC REG DATA=EX61N1; MODEL SALT=AREA/CLM CLI; /* CLM for (100-??) % confidence limits for the expected value of the dependent variable, CLI for (100-??) % confidence limits for an individual predicted value */ TITLE 'CIs FOR MEAN RESPONSE AND FUTURE OBSERVATION'; RUN; QUIT;
6-2 Simple Linear Regression Linear Regression of SALT vs AREA The REG Procedure Model: MODEL1 Dependent Variable: salt Salt Conc Number of Observations Read 20 Number of Observations Used Analysis of Variance Sum of Mean Source DF Squares Square F Value Pr > F Model <.0001 Error Corrected Total Root MSE R-Square Dependent Mean Adj R-Sq Coeff Var Parameter Estimates Parameter Standard Variable Label DF Estimate Error t Value Pr > |t| Intercept Intercept area Roadway area <.0001 Linear Regression of SALT vs AREA The REG Procedure Model: MODEL1 Model Crossproducts X'X X'Y Y'Y Variable Label Intercept area salt Intercept Intercept area Roadway area salt Salt Conc
6-2 Simple Linear Regression SAS 시스템 The REG Procedure Model: MODEL1 Dependent Variable: salt Salt Conc Output Statistics Dependent Predicted Std Error Std Error Student Cook's Obs Variable Value Mean Predict Residual Residual Residual D | **| | | | | | |* | | | | | | | | | | | |* | | |* | | | | | ****| | | | | | |**** | | **| | | |** | | | | | | | | | | | *| | | **| | | |** | Sum of Residuals 0 Sum of Squared Residuals Predicted Residual SS (PRESS)
6-2 Simple Linear Regression
CIs FOR MEAN RESPONSE AND FUTURE OBSERVATION The REG Procedure Model: MODEL1 Dependent Variable: salt Salt Conc Number of Observations Read 21 Number of Observations Used 20 Number of Observations with Missing Values 1 Analysis of Variance Sum of Mean Source DF Squares Square F Value Pr > F Model <.0001 Error Corrected Total Root MSE R-Square Dependent Mean Adj R-Sq Coeff Var Parameter Estimates Parameter Standard Variable Label DF Estimate Error t Value Pr > |t| Intercept Intercept area Roadway area <.0001
6-2 Simple Linear Regression CIs FOR MEAN RESPONSE AND FUTURE OBSERVATION The REG Procedure Model: MODEL1 Dependent Variable: salt Salt Conc Output Statistics Dependent Predicted Std Error Obs Variable Value Mean Predict 95% CL Mean 95% CL Predict Residual Sum of Residuals 0 Sum of Squared Residuals Predicted Residual SS (PRESS)
6-2 Simple Linear Regression Correlation and Regression The sample correlation coefficient between X and Y is
6-2 Simple Linear Regression Correlation and Regression The sample correlation coefficient is also closely related to the slope in a linear regression model
6-2 Simple Linear Regression
6-2.6 Correlation and Regression It is often useful to test the hypotheses The appropriate test statistic for these hypotheses is Reject H 0 if |t 0 | > t /2,n-2.
6-2 Simple Linear Regression OPTIONS NOOVP NODATE NONUMBER LS=80; DATA ex61; INPUT salt area LABEL salt='Salt Conc' area='Roadway area'; CARDS; PROC CORR DATA=EX61; VAR SALT AREA; TITLE 'Correlation between SALT and AREA'; PROC REG; MODEL salt=area/XPX; TITLE 'Linear Regression of SALT vs AREA'; RUN; QUIT; Example 6-1 (Continued)
6-2 Simple Linear Regression Correlation between SALT and AREA CORR 프로시저 2 개의 변수 : salt area 단순 통계량 변수 N 평균 표준편차 합 최솟값 최댓값 salt area 단순 통계량 변수 레이블 salt Salt Conc area Roadway area 피어슨 상관 계수, N = 20 H0: Rho=0 가정하에서 Prob > |r| salt area salt Salt Conc <.0001 area Roadway area <.0001
6-2 Simple Linear Regression Linear Regression of SALT vs AREA The REG Procedure Model: MODEL1 Model Crossproducts X'X X'Y Y'Y Variable Label Intercept area salt Intercept Intercept area Roadway area salt Salt Conc The REG Procedure Model: MODEL1 Dependent Variable: salt Salt Conc Number of Observations Read 20 Number of Observations Used 20 Analysis of Variance Sum of Mean Source DF Squares Square F Value Pr > F Model <.0001 Error Corrected Total Root MSE R-Square Dependent Mean Adj R-Sq Coeff Var Parameter Estimates Parameter Standard Variable Label DF Estimate Error t Value Pr > |t| Intercept Intercept area Roadway area <.0001