PC Labs for SO5041: Week 11

Table of Contents

Week 11 Lab: Correlation


The following data file contains six pairs of variables, X1 and Y1, X2 and Y2 etc.

use http://teaching.sociology.ul.ie/so5041/labs/correl

First, graph all six pairs in scatterplots. Also graph X1 with Y2. What sort of association do you see in each case (positive, negative, none, strong, weak)? Make a guess what the value of the correlation coefficient might be (write it down).

For each graph, get the correlation coefficient: e.g., corr x1 y1. How do the reported correlation coefficients correspond with those you guessed?

Correlations with real data

With the following data file (use http://teaching.sociology.ul.ie/so5041/ocorr), explore the correlations between the variables it contains, graphically and with the correlation coefficient.

Linear Regression

Do sysuse nlsw88 to load the National Longitudinal Study of Women data set that comes with Stata. Look at wage, the hourly wage rate. Predict wage using grade:

reg wage grade

Write out the Y = a + bx equation. Calculate the predicted value for grade=0 and grade=20, and draw the line on a graph (on paper).