Agriculture Reference
In-Depth Information
rule of thumb, regression is used where the independent variable (X)
is fixed, such as in a planned experiment, while with correlation there
is no such constraint. Situations where the independent variable (X) is
random is often referred to as a model II, while fixed effect models are
considered model I; for example, using different rates of fertilizer to
see what effect it has on yield in a replicated study. Correlation, on the
other hand, can be evaluated between any two sets of data.
Correlation is defined as
Covariance XY
Variance XVarianceY
(,)
r
=
(
)
XXYY n
(
) /(
1
)
r
=
2
2
(
XX
)
/(
n
1
)
(
Y
Yn
)/(
− 1)
(
XXYY
)(
)
r
=
2
2
(
XX YY
) (
)
r will be a value between -1 and 1 with values close to -1 or 1 indi-
cating a high degree of correlation whether negative or positive. Load
the dataset Hog Price Data.dta, which is a dataset of marketed hogs
and price per hundred weight (Little and Hills, 1978, p. 172). Let's
begin by graphing the price of hogs against hogs marketed. To do
this, select the Twoway graph (scatter, line, etc.) under the Graphics
menu. This will bring up a dialog box (Figure 10.1) where a new graph
can be constructed.
In this dialog box, select the Create… button to create a new
graph. This will open another dialog when the default plot (Scatter)
is selected. Do not change anything in the dialog box, but select the
price variable from the Y variable: drop down and hogs as the X vari-
able: drop down. Then select the Accept button. Finally, select the OK
button in the Twoway dialog. This will create a scatter plot graph of
these variables as shown in Figure 10.2. This can also be created with
twoway ( scatter price hogs )
 
Search WWH ::




Custom Search