Re: [R] why won't rq draw lines?

From: Adaikalavan Ramasamy <ramasamy_at_cancer.org.uk>
Date: Tue 20 Jul 2004 - 00:22:24 EST

The example in help(rq) works for me.

I presume the problem is not due to attach(forrq) as you get the scatterplot. Why don't you try printing 'xx' and 'yy' inside the loop and see what you get.

On Mon, 2004-07-19 at 14:53, david_foreman@doctors.org.uk wrote:
> I've been trying to draw quantile linear regression lines across a scatterplot of my data using
>
> attach(forrq)
> plot(PREGNANT,DAY8,xlab="pregnant EPDS",ylab="postnatal EPDS",cex=.5)
> taus <- c(.05,.1,.25,.75,.9,.95)
> xx <- seq(min(PREGNANT),max(PREGNANT),100)
> for(tau in taus){
> f <- coef(rq(DAY8~PREGNANT,tau=tau))
> yy <- (f[1]+f[2]*xx)
> lines(xx,yy)
> }
> which is simply the method from the help file with my dataset attached, and the variable names substituted where appropriate. I get the scatterplot, but no lines. Any ideas about what's going on? or wrong?
>
>
> _______________________________________________________________________
> Most doctors use http://www.Doctors.net.uk e-mail.
> Move to a free professional address with spam and virus protection.
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>



R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Jul 20 00:30:01 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:55:04 EST