Lab 4 Instructions
Lab 4 Instructions
(Much of this lab is adapted from the SOFA Manual by George Self. The entire manual is
located in Week 1.)
CORRELATION
From the outset of this lab, it is important to remember that there is a huge difference between
correlation and causation. Just because two factors are correlated in some way does not lead to a
conclusion that one is causing the other. As an example, if a research project found that students
who spend more hours studying tend to get higher grades this would be an interesting
correlation. However, that research, by itself, could not prove that longer studying hours causes
higher grades. There could be other intervening factors that are not accounted for in this simple
correlation (like the type of final examination used). As an egregious example to prove this
point, consider that the mean age in the United States is rising (that is, people are living longer;
thus, there are more elderly people in the population) and that human trafficking crime is
increasing. While these two facts may be correlated, it would not follow that old people are
responsible for human trafficking! Instead, there are numerous social forces in play that are not
accounted for in this simple correlation. It is important to keep in mind that correlation does not
equal causation as you read research.
Pearson’s R
Pearson’s Product-Moment Correlation Coefficient (normally called Pearson’s r) is a measure of
the strength of the relationship between two variables. Pearson’s r is a number between -1.0 and
+1.0, where 0.0 means there is no correlation between the two variables and either +1.0 or -1.0
means there is a perfect correlation. A positive correlation means that as one variable increases
the other also increases. For example, as people age they tend to weigh more so a positive
correlation would be expected between age and weight. A negative correlation, on the other
hand, means that as one variable increases the other decreases. For example, as people age they
tend to run slower so a negative correlation would be expected between age and running speed.
In general, both the strength and direction of a correlation is indicated by the value of “r”:
Data Source Table: gifted (It is desired to see if there is a correlation between the age when
children first learn to count and the time spent watching cartoons.)
Group A: Count (this is the “X-Axis” or independent variable)
Group B: Cartoons (this is the “Y-Axis” or dependent variable)
Click “Show Results” and read the results at the bottom of the window. SOFA reports the “Two-
tailed p value” of 0.3670, Pearson’s R of 0.155, with 34 degrees of freedom.
SOFA also displays a scatter plot with a regression line and reports its slope (0.023) and Y-
Intercept (2.371).
Notice the p value is .3670 which is well able the cut off of .05 so there is not a statistically
significant relationship between the two variables. The Pearson’s r statistic is .155 which shows
no correlation between the number of hours of cartoons watched and age when a child learns to
count.
Spearman’s Rho
Pearson’s r is only useful if both data elements being correlated are interval or ratio in nature.
When the one or both data elements are ordinal or nominal then a statistically different process
must be used to calculate a correlation, and that process is Spearman’s Rho. Other than the
process used to calculate Spearman’s Rho, the concept is exactly the same as for Pearson’s r and
the result is a correlation between -1 and +1 where the strength and direction of the correlation is
determined by its value.
Pearson’s r and Spearman’s Rho both calculate correlation and it is reasonable to wonder which
method should be used in any given situation. A good rule of thumb is to use Pearson’s r if both
data items being correlated are interval or ratio and use Spearman’s rho if one or both are ordinal
or nominal. Imagine a series of survey questions that permitted people to select from only a
small group of possible answers. As an example, perhaps respondents are asked to select
one of five responses ranging from “Strongly Agree” to “Strongly Disagree” for statements like
“I enjoyed the movie.” Restricting responses to only one of five options creates ordinal data and
to determine how well the responses to these questions correlate with something like the
respondents’ ages, Spearman’s Rho would be an appropriate choice.
Chi-Square
One of the most common measurements of statistical significance is the chi-square test, but this
test should only be used if both variables are nominal. The basic idea behind this test is to
determine what values would be expected by chance and compare that to the values actually
obtained by experiment.
As an aid to determining whether a calculated chi-square is significant, a p-value (that stands for
“probability value”) is usually also calculated. A p-value answers the question, “what is the
probability that an observed phenomenon is due to chance?” It’s important to note that as the chi-
square statistic gets larger the p-value gets smaller since there is an inverse relationship between
those values. A significant correlation would have a large chi-square statistic and a small p-level
value (less than 0.05, normally).
Scatter plots
A scatter plot is a two-dimensional graph of ordered pairs that indicates the relationship between
two variables. While a scatter plot could be created from nominal or ordinal data, it is normally
only used for interval and ratio data. Each of the red dots is a single point in the dataset.
REGRESSION
A regression line can be drawn on a scatter plot to graphically show the relationship between two
variables (this is sometimes called a “trend line” and a “line of best fit”). Moreover, if the data
points in the scatter plot are all close to the regression line, then it is a strong correlation.
Using the slope and y-intercept, calculate the expected test score
for a mother’s IQ of 118.
y = (0.407)(118) + 111.093
y = 159.119
The slope indicates a positive correlation, meaning as the maternal IQ increases so does the score
on the test for the child. The Pearson’s r statistic shows a strong correlation. The p value shows
that the relationship is statistically significant.
Statistics Wizard
If the type of data and the question being asked is known then SOFA includes a Wizard to help
select an appropriate statistics test. To access the wizard, open SOFA and select “Statistics.”
Then click “Or Get Help Choosing Below.”
The text above the histogram reports “Rely on visual inspection of graph. Although the data
failed the ideal normality test, most real-world data-sets with as many results (1000) would fail
for even slight differences from the perfect normal curve. Skew (lopsidedness) is -1.145 which is
probably a good sign. Kurtosis (peakedness or flatness) is 2.7 which is probably not a good
sign.” In this case, there are 1000 birth weights recorded so the skew and kurtosis numbers need
to tempered by the visual appearance of the histogram. Since the histogram shows a large center
peak with “shoulders” on both sides this data can be treated as normally distributed.
Next, the researcher must determine if the data are independent observations or paired. In this
case there is no pairing indicated so the researcher chooses “Independent.”
SOFA indicates that “t-test - independent” is the correct test for the data being analyzed, so the
researcher clicks the “Configure Test” button at the top right corner of the window and proceeds
to execute that test. All of the various statistical tests in SOFA are described on the following
pages of this lab.
ANOVA
SOFA makes it easy to complete any of the statistical tests listed in this lab exercise. A Wizard
provides help in selecting an appropriate test but users can also manually select and configure
whatever test they need.
Start SOFA and click the "Statistics" button
Select "ANOVA" from the Statistical Test list at the top of the window and then click the
"Configure Test" button
Data Source Table: Hypothetical dataset
Averaged variable: SBI
Group By variable: ethnic
Group A: group 1
Group B: group 2
Click “Show Results”
df. The degrees of freedom is calculated for the groups being analyzed. The degrees of
freedom is one less than the number of groups.
Mean Sum of Squares. This is the mean of the sum of the squares. This is calculated as
the sum of squares divided by the degrees of freedom. (Note: the Mean Sum of Squares
for the Within Source is frequently referred to as the “residuals”).
F. This is the value of the “F-Test” for this ANOVA. An F-Test is the ratio between two
mean square values and used to indicate if the variance between groups is significantly
different from the variance within the groups. In general, if the null hypothesis is true
then the F-Test value will be close to one, that is, there is not much difference in the
variance between groups when compared to the variance within a group. In the example
calculated for this exercise, the F-Test value is 155.821 which is much larger than one
and would indicate that there is a significant difference in the variance of the “no” and
“yes” groups.
p value. This is computed from the F-value and is used to determine if the null
hypothesis can be rejected. Most research reports include only the P-Value rather than all
of the other calculated statistics since it summarizes the result into a single easy-to-
understand number. In most cases a P-Value less than 0.05 (5%) indicates that there is a
significant difference in the groups being compared. In the example calculated for this
exercise, the P-Value is far less than 0.05 (at 6.125 10-35) so the result is significant and
the null hypothesis can be rejected.
O’Brien’s Test. This test is commonly used to indicate if the variances within two
groups is significantly different. If the value of O’Brien’s test is less than 0.05 (5%) then
the difference in the two variances is significant. In the example calculated for this
exercise, O’Brien’s test is well under 0.05 (at 4.731 10-14), so the difference in the
variance within the “no” group and “yes” group is significant.
T-Test Independent
p Value. The most important statistic in the results window is the p-value. As always, when this
number is encountered it is desired for it to have a value less than 0.05 (5%). In the example
calculated for this exercise, the p-value is 0.02779, which is less than 0.05, so there is a
significant relationship between Birth Weight and Smoking Habit in this dataset.
t Statistic. This number is of little value except, perhaps, to compare the results of one
independent t-Test to another. In general, the greater the t-statistic the more likely the null
hypothesis can be rejected, but it is challenging to find an appropriate “cutoff” score. Therefore,
the most important result of an independent t-Test is the p-value.
Degrees of Freedom (df). The degrees of freedom is calculated as the number of different birth
weights times one less than the number of groups.
O’Brien’s Test. This test is commonly used to indicate if the variances within two groups is
significantly different. If the value of O’Brien’s test is less than 0.05 (5%) then the difference in
the two variances is significant. In the example calculated for this exercise, O’Brien’s test greater
than 0.05 (at 0.4154), so the difference in the variance between the “Nonsmoker” and “Smoker”
groups is not significant.
Other Statistics. The table shows a number of statistical values for the two groups and each of
the types of values have been described elsewhere.
Histograms. The results window includes a histogram for each of the groups in the calculation,
similar that that found for an ANOVA. Those histograms are not reproduced here.