I am trying to plot a regression, but I keep getting a bar grpag

If stock holds and xts of my stock return data, and Market holds an xts of market return data, For the CAPM regression, I simply use:

    CAPMreg <- lm(Stock ~ Market)
    plot(
        as.zoo(Market),
        as.zoo(Stock),
        xlab = "X (Market Excess Return)",
        ylab = "Y (Stock Excess Return)",
        cex.main = 1.5,
        frame.plot = FALSE,
        col = "blue"
)  ##  col=ifelse((x*y<0), "red", "blue")
    abline(CAPMreg)

done - I get a beautiful plot:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.