Agriculture Reference
In-Depth Information
Residuals are the differences between the actual data and the predic-
tion expected from the model. To see these graphs, a regression must
first be performed, then these commands can be entered. With the
Hen Regression.dta in memory, enter the following:
regress food weight
hen enter
rvfplot, yline( 0 )
and then
rvpplot weight, yline(0)
The first command is to ensure that a regression has been calcu-
lated; otherwise the next two lines will result in an error message.
The next command graphs the fitted versus residual data and, finally,
the rvpplot graphs the predictor (weight) versus the residuals. The
yline (0) places the red horizontal line on the graph to make the
results more readable. FigureĀ 10.3 shows these results. Stata can only
display one graph window at a time; therefore, as each new graph
command is entered, the graph window shows those results. Once a
graph is saved it can be opened at the same time the Graph window
is displaying the other graph. Graphs appear, then, on the left side of
the Graph window.
These graphs should have their plotted values occurring randomly
around 0 on the y -axis. If there were a pattern to these data points,
then it would indicate that the residuals were not random and inde-
pendent. Although these plots appear very similar, with more complex
regressions, with more than one independent variable, these graphs
will appear different from each other.
Let's look at another dataset that shows an example where these
residuals show such a pattern. Load the dataset Rice Varieties
Regression.dta. This is a dataset of tiller numbers and yield for two
different rice varieties (Gomez and Gomez, 1984, p. 373). Again
run the regression ( regress yield tiller ) and plot the residu-
als against the predictor and fitted values ( rvfplot and rvpplot
tiller ).
Search WWH ::




Custom Search