STATISTICS 3AO3
Applied Regression Analysis with SAS
Angelo J. Canty
Oce :
Hamilton Hall 209
Phone :
(905) 525-9140 extn 27079
E-mail :
[email protected]
Lab (Mandatory) : Tuesday, 5:30pm in BSB-249.
Oce Hours : Monday, Thursday 10:30-11:30
or at other t
Simple Linear Regression
In simple linear regression we are concerned about the relationship between two variables, X and Y .
There are two components to such a relationship.
1. The strength of the relationship.
2. The direction of the relationship.
We
Multiple Linear Regression
Simple linear regression tries to t a simple line between two
variables Y and X .
If X is linearly related to Y this explains some of the variability
in Y .
In most cases, there is still a lot of variability about the line
re
Diagnostics
All statistical modeling is based on some assumptions.
It is important to check those assumptions before making
any conclusions.
This is the process of model checking and is based on diagnostics.
Diagnostics may be graphical or numerical.
Categorical Predictor Variables
We often wish to use categorical (or qualitative) variables as
covariates in a regression model.
For binary variables (taking on only 2 values, e.g. sex), it is
relatively easy to include them in the model.
Usually one l
Transformations
In many cases we do not analyze the original data.
If Y and X are the observed variables we may t the model
gy (Y ) = 0 + 1gx(X ) +
The functions gy and gx are transformations applied to the
original data.
We will look at what transfo
Weighted Least Squares
The standard linear model assumes that Var(i) = 2 for
i = 1, . . . , n.
As we have seen, however, there are instances where
2
Var(Y | X = xi) = Var(i) =
.
wi
Here w1, . . . , wn are known positive constants.
Weighted least squar
Variable Selection
A very common problem in regression is to decide on a set
of covariates to be included in the model.
We will generally collect observations on a relatively large
number of covariates and then use some of the techniques
in this chapter
Student Name
Student Number
STATISTICS 3A03
FALL 2011
DR. ANGELO CANTY
DAY CLASS
DURATION OF EXAMINATION: 3 Hours
MCMASTER UNIVERSITY FINAL EXAMINATION
December 10, 2011
THIS EXAMINATION PAPER INCLUDES 10 PAGES AND 8 QUESTIONS. YOU ARE RESPONSIBLE FOR
ENS
McMaster University
Department of Mathematics and Statistics
STATISTICS 3A03: Applied Regression Analysis with SAS
Fall 2012
SAS Lab 1. September 18, 2012
Topics Covered in this Lab
1. The SAS Editor.
2. Libnames
3. Importing data from plain text les usin
McMaster University
Department of Mathematics and Statistics
STATISTICS 3A03: Applied Regression Analysis with SAS
Fall 2012
SAS Lab 2. September 25, 2012
Topics Covered in this Lab
1. PROC PLOT
2. PROC GPLOT
3. PROC CORR
4. PROC REG
1. PROC PLOT This pro
McMaster University
Department of Mathematics and Statistics
STATISTICS 3A03: Applied Regression Analysis with SAS
Fall 2012
SAS Lab 3. October 2, 2012
Topics Covered in this Lab
1. Multiple Regression
2. Prediction
1. Multiple Regression Multiple regress
McMaster University
Department of Mathematics and Statistics
STATISTICS 3A03: Applied Regression Analysis with SAS
Fall 2012
SAS Lab 5 & 6. October 16 & 23, 2012
Diagnostic Plots in Regression
In class we are currently covering various diagnostic plots to
McMaster University
Department of Mathematics and Statistics
STATISTICS 3A03: Applied Regression Analysis with SAS
Fall 2012
SAS Lab 7, October 30, 2012
Analysis of Variance
In this lab we shall cover the use of PROC REG and PROC GLM to run ANOVA type mod
McMaster University
Department of Mathematics and Statistics
STATISTICS 3A03: Applied Regression Analysis with SAS
Fall 2012
SAS Lab 8, November 6, 2012
Analysis of Covariance
In this lab we shall cover the use of PROC GLM to analyze general linear models
McMaster University
Department of Mathematics and Statistics
STATISTICS 3A03: Applied Regression Analysis with SAS
Fall 2010
SAS Lab 9, November 13, 2012
Transformations
It is relatively easy to t transformations in SAS. All that is really necessary is to
McMaster University
Department of Mathematics and Statistics
STATISTICS 3A03: Applied Regression Analysis with SAS
Fall 2010
SAS Lab 10, November 20, 2012
Weighted Least Squares
Weighted least squares can be done either using a transformation model as we
STAT 3A03 Applied Regression With SAS
Fall 2012
Assignment 1 Solution Set
Q. 1
a) (i)
n
(xi x)2
Sxx =
i=1
n
(x2 2xi x + x2 )
i
=
i=1
n
n
x2
i
=
xi + nx2
2x
i=1
i=1
n
x2 2nx2 + nx2
i
=
i=1
n
x2 nx2
i
=
i=1
[5 marks]
(ii)
n
(xi x)(yi y )
Sxy =
i=1
n
(xi yi
STAT 3A03 Applied Regression With SAS
Fall 2012
Assignment 2 Solution Set
Q. 1 Let the data be (x11 , . . . , x1n ), (x21 , . . . , x2n ) and (y1 , . . . , yn ). To avoid confusion, I will use the
following notation in this question
n
(x1i x1 )2
S11 =
i=1
STAT 3A03 Applied Regression With SAS
Assignment 5 Solution Set
Q. 1
a) The code that I used and the output is as follows
PROC GLM Data=Wool;
Class Amp Len Load;
Model Cycles=Amp Len Load;
Output Out=woolout
predicted=fitted
student=student;
run;
quit;
Th
McMaster University
Stats 3A03- Midterm I Exam
Thursday, October 8, 2009
QUESTIONS & SOLUTIONS
Question 1 (30 points): Find , , R and write the regression equation for this data and
interpretate the coefficients of regression model and the coefficient of
STATISTICS 3A03
Fall 2012
Dr. Angelo Canty
TERM TEST 1
October 18, 2012.
DAY CLASS
DURATION OF EXAMINATION: 50 Minutes
THIS EXAMINATION PAPER INCLUDES 4 PAGES AND 3 QUESTIONS. YOU ARE RESPONSIBLE
FOR ENSURING THAT YOUR COPY OF THE PAPER IS COMPLETE. BRING
STAT 3A03 Applied Regression With SAS
Term Test 1 Solution Set
Q. 1
a) The sum of squared errors is
n
(yi 2 1 xi )2
S (1 ) =
i=1
[2 marks]
To minimize this we take the derivative with respect to 1
dS (1 )
= 2
d1
n
xi (yi 2 1 xi )
i=1
Now we set that equal
STATISTICS 3A03
Fall 2012
TERM TEST 2
Dr. Angelo Canty
November 22, 2012.
DAY CLASS
DURATION OF EXAMINATION: 50 Minutes
THIS EXAMINATION PAPER INCLUDES 5 PAGES AND 3 QUESTIONS. YOU ARE RESPONSIBLE
FOR ENSURING THAT YOU COPY OF THE PAPER IS COMPLETE. BRING
STAT 3A03 Applied Regression With SAS
Term Test 2 Solution Set
Q. 1
a) An outlier is a point which deviates from the linear model. Such a point can usually be seen
from plots of the studentized residuals since it has a large studentized residual (in absol