Skip to content
Prev 280213 / 398506 Next

Problem with ploting fitted values

matys <mts89 <at> o2.pl> writes:
If you try:

plot(t, AIRlm$fitted, col=2, lwd=2)

you can see that it does plot the points.  But note the x-axis.  The problem
with adding them to your original plot is that the x values (2:144) are out of
the range of the x-axis of the original plot, which is of a time series.

Try:

# transforming into parallel time series
AIRlm$fitted.ts <- ts(AIRlm$fitted, start = c(1949,1), frequency = 12)

plot(lgAP, main="Log of Air Passengers",type="l", col=4, lty=2, lwd=2)
lines(AIRlm$fitted.ts, col=2, lwd=2)


Hope this helps,

Michael Bibo
Queensland Health