Sociology 601, Class17: October 27, 2009. Linear relationships. A & F, chapter 9.1 Least squares estimation. A & F 9.2 The linear regression model (9.3). Example of a linear Relationship. Equation for a linear relationship.
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Equation for a linear relationship
Example of a linear relationship
Example of a linear relationship
Key terms for linear relationships
More key terms for linear relationships
More key terms for linear relationships
(note: and are both population parameters like )
More key terms for linear relationships
using least squares regression
Linear prediction: an example.
Plotting a linear relationship in STATA
. plot attend regul
82 +
 *





a 
t 
t 
e 
n  * *
d 

 * *
 * *
 * * *

 * *

3 + * *
++
0 regul 6
Solving a least squares regression, using STATA
Finding the predicted values of religious attendance (yhat) for each observed level of regulation (x)
%attend = 36.8  5.4 * regul
for each observed level of X, using STATA
. predict pattend
(option xb assumed; fitted values)
. tabulate pattend regul
Fitted  regul
values  0 1 2 3 5 6 Total
++
4.683761  0 0 0 0 0 2 2
10.04274  0 0 0 0 2 0 2
20.76068  0 0 0 5 0 0 5
26.11966  0 0 2 0 0 0 2
31.47863  0 1 0 0 0 0 1
36.83761  6 0 0 0 0 0 6
++
Total  6 1 2 5 2  18
you can use the predict command only after you have used regress to estimate the regression function.
for each observed level of X  in STATA
. plot pattend regul
36.8376 +
 *


F 
i  *
t 
t 
e  *
d 

v  *
a 
l 
u 
e 
s 
 *


4.68376 + *
++
0 regul 6
Least squares prediction: formal terms
Least squares prediction: equation for b
Least squares prediction: more terms
Least squares prediction: still more terms
Calculating the residuals for each observation, using STATA
Plotting the residuals for each observed level of X, using STATA
. plot rattend regul
45.1624 +

 *



R 
e 
s 
i 
d  *
u  *
a  *
l  *
s  *
 * *
 * *
 * * *
 *
 *
19.4786 + * *
++
0 regul
do you notice the residual that is an outlier?
This operation is analogous to calculating a variance, without dividing by n1.
(Yi– Ybar)2
(Yi– Yhat)2
9.3 the linear regression model
for the linear regression model
example of conditional standard deviation
Solving a least squares regression, using STATA
interpreting the conditional standard deviation
Conditional standard deviation and
Marginal standard deviation