Re: [R] question about "lines"

2013-09-18 Thread meng
Ok,many thanks for your detailed answer. At 2013-09-18 19:20:26,"Duncan Murdoch" wrote: >On 13-09-18 1:38 AM, meng wrote: >> Oh,yes, I found out this according to your reply.Thanks. >> >> As to time series analysis, in order to show the effect of smoothing or >> filtering,the common comman

Re: [R] question about "lines"

2013-09-18 Thread Duncan Murdoch
On 13-09-18 1:38 AM, meng wrote: Oh,yes, I found out this according to your reply.Thanks. As to time series analysis, in order to show the effect of smoothing or filtering,the common command is: plot(ts0); lines(fitted(...)) But not "lines(fitted(...) ~ time(ts) )" How to understand this then?

Re: [R] question about "lines"

2013-09-18 Thread meng
Oh,yes, I found out this according to your reply.Thanks. As to time series analysis, in order to show the effect of smoothing or filtering,the common command is: plot(ts0); lines(fitted(...)) But not "lines(fitted(...) ~ time(ts) )" How to understand this then? Many thanks. Best. At 20

Re: [R] question about "lines"

2013-09-17 Thread Duncan Murdoch
On 13-09-17 6:36 PM, meng wrote: Thanks for your reply. Is "fitted(lm(...))" the same as "values" of lines(values)? If yes,then why the range of lines(values) is different from range(fitted(lm(...)))? You are plotting against the wrong x axis, and you don't see all the values. Duncan Murdoch

Re: [R] question about "lines"

2013-09-17 Thread meng
Thanks for your reply. Yes, abline is much better,but it can only add straight line,and lines(fitted(lm(y~x)) ~ x) can do the same thing but not constrain to straight line. At 2013-09-17 20:45:08,"Bretschneider (R)" wrote: Dear meng, Re: Hi all: I met a question about "lines". atta

Re: [R] question about "lines"

2013-09-17 Thread meng
Thanks for your reply. Is "fitted(lm(...))" the same as "values" of lines(values)? If yes,then why the range of lines(values) is different from range(fitted(lm(...)))? If no, what "values" refers to? At 2013-09-17 20:56:04,"Duncan Murdoch" wrote: >On 13-09-17 8:06 AM, meng wrote: >> Hi a

Re: [R] question about "lines"

2013-09-17 Thread Duncan Murdoch
On 13-09-17 8:06 AM, meng wrote: Hi all: I met a question about "lines". attach(cars) plot(dist ~ speed) #add the regression line to the plot lines(fitted(lm(dist~speed)) ~ speed) plot(dist ~ speed) #what kind of curve does the following command add to the plot? lines(fitted(lm(dist~speed))

Re: [R] question about "lines"

2013-09-17 Thread Bretschneider (R)
Dear meng, Re: > Hi all: > I met a question about "lines". > > > attach(cars) > > > plot(dist ~ speed) > #add the regression line to the plot > lines(fitted(lm(dist~speed)) ~ speed) > > > plot(dist ~ speed) > #what kind of curve does the following command add to the plot? > lines(fitted(lm

[R] question about "lines"

2013-09-17 Thread meng
Hi all: I met a question about "lines". attach(cars) plot(dist ~ speed) #add the regression line to the plot lines(fitted(lm(dist~speed)) ~ speed) plot(dist ~ speed) #what kind of curve does the following command add to the plot? lines(fitted(lm(dist~speed))) My question is : what kind of c