I know this topic has had plenty of discussion in the last couple of days,
but....
I've been trying to compare the effects of different fitted methods for
systems of equations (OLS, SUR, 2SLS, 3SLS ) and would like to compare the
residual plots (easy) and the qqnorm/qqplot of the fits for the different
fitted methdos. For example,
qqnorm( residuals( lm( q ~ p + f + a ) ) )
par( new = TRUE )
qqnorm( residuals( tsls( q ~ p + d, ~ d + f + a ) ) )
The resulting plot contains the two qqnorm plots, and the x axis stays the
same. The y axis ("Sample Quantiles") scales for the different plots.
I
would to fix the y axis (fix the quantiles values?) and plot the different
plots in different colors. Is that possible?
Thanks,
Jeff.
Jeff D. Hamann
Hamann, Donald and Associates
PO Box 1421
Corvallis, Oregon USA 97339-1421
Bus. 541-753-7333
Cell. 541-740-5988
jeff_hamann at hamanndonald.com
www.hamanndonald.com
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at
stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
"Jeff D. Hamann" <jeff_hamann at hamanndonald.com> writes:> The resulting plot contains the two qqnorm plots, and the x axis stays the > same. The y axis ("Sample Quantiles") scales for the different plots. I > would to fix the y axis (fix the quantiles values?) and plot the different > plots in different colors. Is that possible?Something along these lines: q1 <- qqnorm( residuals( lm( q ~ p + f + a ) ), plot.it=F ) q2 <- qqnorm( residuals( tsls( q ~ p + d, ~ d + f + a ) ), plot.it=F ) yl <- range(q1$y,q2$y) qqnorm( residuals( lm( q ~ p + f + a ) ), ylim=yl) points(q2, col="red") -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hi> I know this topic has had plenty of discussion in the last couple of days, > but.... > > I've been trying to compare the effects of different fitted methods for > systems of equations (OLS, SUR, 2SLS, 3SLS ) and would like to compare the > residual plots (easy) and the qqnorm/qqplot of the fits for the different > fitted methdos. For example, > > qqnorm( residuals( lm( q ~ p + f + a ) ) ) > par( new = TRUE ) > qqnorm( residuals( tsls( q ~ p + d, ~ d + f + a ) ) ) > > The resulting plot contains the two qqnorm plots, and the x axis stays the > same. The y axis ("Sample Quantiles") scales for the different plots. I > would to fix the y axis (fix the quantiles values?) and plot the different > plots in different colors. Is that possible?Yep, ylim can be specified as usual ... y1 <- rnorm(100) y2 <- rexp(100) qqnorm(y1, ylim=range(y1, y2), col="blue") par(new=T) qqnorm(y2, ylim=range(y1, y2), col="red") ... NOTE that this does a lot of unnecessary drawing; an alternative is to get qqnorm to just tell you what x- and y-values it would plot and then use points() to add the new points rather than draw a whole new plot ... y1 <- rnorm(100) y2 <- rexp(100) qqnorm(y1, ylim=range(y1, y2), col="blue") secondpts <- qqnorm(y2, plot.it=FALSE) points(secondpts, col="red") Hope that helps. Paul -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._