Agriculture Reference
In-Depth Information
This results in the following output:
(obs=10)
| price hogs
------+------------------
price | 1.0000
hogs | -0.7068 1.0000
We can see by the output that there is a fairly high negative correlation
between hogs sold and price at -0.7068. This suggests that the higher
the supply the lower the price. This reflects the classic relationship
between supply and demand. Remember, however, that this relation-
ship is not an absolute cause and effect relationship. There could be
conditions where prices are high and hogs sold are high as well. There
are usually more factors affecting a market than price or supply alone.
Squaring r results in the coefficient of determination ( r 2 ). This value
will be between 0 and 1 and indicates the portion of the total sum of
squares due to the independent variable. In this context, it has impor-
tant consequences in regression analysis.
Another method of calculating a correlation is Spearman's rank
correlation coefficient. This method relies on the differences in rank of
the data points. The formula for Spearman's rank correlation is
2
6
d
i
r
=−
1
s
2
nn
(
1
)
where d i is the difference between ranks for each pair of observations
and n is the number of pairs of observations. Spearman's correlation is
a nonparametric measure that does not rely on a normal distribution.
Spearman's correlation also occurs on a scale of -1 to 1 with values
close to these showing a high degree of correlation. Load the dataset
Nicotiana correlation.dta. This is a dataset of flower measurements
from a Nicotiana cross (Steel and Torrie, 1980, p. 276). First enter the
following command:
correlate tube limb base
This results in a matrix of correlations between the three variables.
Now enter the following command:
Search WWH ::




Custom Search