Graphics Reference
In-Depth Information
scatter close predclose tradeday
Say that we used the regress
command to predict close from
tradeday and generated a predicted
value called predclose . Here, we plot
the actual closing prices and the
predicted closing prices.
Uses spjanfeb2001.dta & scheme vg s2c
0
10
20
30
40
Trading day number
Closing price
Lin. Fit close from tradeday
scatter close predclose tradeday, connect(i l) sort
msymbol(.
i)
We use the connect(i l) option to
connect the predicted values and leave
the observed values unconnected. The i
option with close indicates that the
closing values are not connected, and
the l (letter l) option indicates that the
predclose values should be connected
with a straight line. We also add
msymbol(. i) to make the symbols
invisible for the fit values.
Uses spjanfeb2001.dta & scheme vg s2c
0
10
20
30
40
Trading day number
Closing price
Lin. Fit close from tradeday
scatter close tradeday, connect(J) sort
In other contexts (such as survival
analysis), we might want to connect
points using a stairstep pattern. Here,
we connect the observed closing prices
with the J option (which can also be
specified as stairstep ) to get a
stairstep effect.
Uses spjanfeb2001.dta & scheme vg s2c
0
10
20
30
40
Trading day number
The electronic form of this topic is solely for direct use at UCLA and only by faculty, students, and staff of UCLA.
Search WWH ::




Custom Search