[R] lines(lowess()) trouble

Mahbub Latif ahmlatif at yahoo.com
Wed Nov 26 18:07:36 CET 2003


Try this...

plot(log(test$x), log(test$y))
lines(lowess(log(test$x), log(test$y)))

your lowess was using different observations than you
plotted.

Mahbub.
--- ivo welch <ivo.welch at yale.edu> wrote:
> 
> hi:    apologies for taking up everyone's time.  my
> problem is probably 
> documented somewhere, but I again cannot find it. 
> (which reminds me: I cannot 
> find a search engine that allows me to search the
> archives of this very useful 
> mailing list.)
> 
> * it seems that lines(lowess()) fails to plot
> certain line segments.  (and, 
> what does it do at the x-min and x-max of a data
> set?)  Rather than speculate 
> what causes it, I am including a short R snippet and
> a short data set that 
> demonstrates it.  is this a bug or a feature?
> 
> * it would be nice if lowess was a little better
> documented.  I have easy 
> access to Becker-Chambers-Wilks, but not to JASA and
> AS.  I wish "?lowess" 
> would tell me a little more about the method.
> 
> thanks in advance.
> 
> regards, /iaw
> 
> -------- test.R
> test <- read.table(file="test.txt", sep="\t",
> header=T);
> plot( test$x, test$y, log="xy");
> lines( lowess( test$x, test$y, f=0.5 ) );
> 
> -------- test.txt
> x	y
> 5584440	5000
> 2300100	1
> 37320	3977
> 92500	1
> 38440	1
> 70000	1
> 161282	151759
> 963000	7453
> 200000	5000
> 162000	1
> 29100	1200
> 20000	1
> 7921000	8112906
> 100000	1
> 426500	1
> 200000	1
> 450000	1
> 1900000	1
> 220001	2000
> 109901	13463
> 16300	6965
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
>
https://www.stat.math.ethz.ch/mailman/listinfo/r-help




More information about the R-help mailing list