Re: [R] Force regression line to a 1:1 relationship

2011-09-15 Thread Bert Gunter
This sounds like you need a mixed effects model (e.g. lme or lmer instead of lm) instead of the possibly spurious adhocery that you describe. I suggest you post your message on the SIG-mixed-effects list and/or get help from a local statistician Cheers, Bert On Thu, Sep 15, 2011 at 1:49 AM, RCull

Re: [R] Force regression line to a 1:1 relationship

2011-09-15 Thread RCulloch
Many thanks to all of you! AV plots are what I am trying to plot. Perhaps to reduce confusion I can give you an example of what I am doing: I am looking at behaviour of re-sighted individuals over two time points. I use lm() on these data and obtain the residuals. Then I am interested to know wh

Re: [R] Force regression line to a 1:1 relationship

2011-09-14 Thread John Fox
Dear S., On Wed, 14 Sep 2011 16:48:55 +0100 S Ellison wrote: > > From: John Fox [mailto:j...@mcmaster.ca] > > Subject: Re: [R] Force regression line to a 1:1 relationship > > If I understand correctly what you said, a plot of residuals > > against an X is not an added

Re: [R] Force regression line to a 1:1 relationship

2011-09-14 Thread S Ellison
> From: John Fox [mailto:j...@mcmaster.ca] > Subject: Re: [R] Force regression line to a 1:1 relationship > If I understand correctly what you said, a plot of residuals > against an X is not an added-variable plot. An added variable 'Added variable plots' was the phras

Re: [R] Force regression line to a 1:1 relationship

2011-09-14 Thread Patrick Breheny
On 09/14/2011 11:36 AM, David Winsemius wrote: On Sep 14, 2011, at 10:52 AM, Patrick Breheny wrote: The latter type of plot is called a "partial regression plot" or "added variable plot". They are discussed in any regression textbook, as well as wikipedia and probably dozens of other web sites.

Re: [R] Force regression line to a 1:1 relationship

2011-09-14 Thread David Winsemius
On Sep 14, 2011, at 10:52 AM, Patrick Breheny wrote: On 09/13/2011 04:27 PM, David Winsemius wrote: ... Also should be plotting against fitted() rather than regressors. ... Both types of plots (vs. fitted values and vs. regressors) are very common. The former is a default plot in R, the f

Re: [R] Force regression line to a 1:1 relationship

2011-09-14 Thread John Fox
Dear S Ellison, If I understand correctly what you said, a plot of residuals against an X is not an added-variable plot. An added variable plot is constructed by regressing Y on all the Xs but the focal X, and regressing the focal X on all the other Xs; then the residuals from the first regress

Re: [R] Force regression line to a 1:1 relationship

2011-09-14 Thread S Ellison
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Patrick Breheny > > The latter type of plot is called a "partial regression plot" > or "added variable plot". They are discussed in any > regression textbook, as well as wi

Re: [R] Force regression line to a 1:1 relationship

2011-09-14 Thread Patrick Breheny
On 09/13/2011 04:27 PM, David Winsemius wrote: ... Also should be plotting against fitted() rather than regressors. ... Both types of plots (vs. fitted values and vs. regressors) are very common. The former is a default plot in R, the first one that appears if you submit: fit <- lm(y~X) pl

Re: [R] Force regression line to a 1:1 relationship

2011-09-13 Thread David Winsemius
On Sep 13, 2011, at 11:56 AM, David Winsemius wrote: On Sep 13, 2011, at 11:44 AM, David Winsemius wrote: On Sep 13, 2011, at 9:43 AM, RCulloch wrote: Dear John, Thank you for that, and for explaining why the abline() command wont/dosen't work. The approach is based on reviewers commen

Re: [R] Force regression line to a 1:1 relationship

2011-09-13 Thread David Winsemius
On Sep 13, 2011, at 11:44 AM, David Winsemius wrote: On Sep 13, 2011, at 9:43 AM, RCulloch wrote: Dear John, Thank you for that, and for explaining why the abline() command wont/dosen't work. The approach is based on reviewers comments that I am a tad sceptical about myself but yet curi

Re: [R] Force regression line to a 1:1 relationship

2011-09-13 Thread David Winsemius
On Sep 13, 2011, at 9:43 AM, RCulloch wrote: Dear John, Thank you for that, and for explaining why the abline() command wont/ dosen't work. The approach is based on reviewers comments that I am a tad sceptical about myself but yet curious enough to test their suggestion..I don't think

Re: [R] Force regression line to a 1:1 relationship

2011-09-13 Thread RCulloch
David & JC, Excellent point, of course it does - and of course that is (should have been) obvious!!! That is what I get for taking a reviewers comment/suggestion as gospel without applying a bit of thought! I'm off to go and kick myself. Cheers, Ross -- View this message in context: htt

Re: [R] Force regression line to a 1:1 relationship

2011-09-13 Thread RCulloch
Dear John, Thank you for that, and for explaining why the abline() command wont/dosen't work. The approach is based on reviewers comments that I am a tad sceptical about myself but yet curious enough to test their suggestion..I don't think it is very straightforward to explain; however, it in

Re: [R] Force regression line to a 1:1 relationship

2011-09-13 Thread John Fox
Dear Ross, But the residuals are just y - x. Best, John > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of RCulloch > Sent: September-13-11 9:19 AM > To: r-help@r-project.org > Subject: Re: [R] Force regres

Re: [R] Force regression line to a 1:1 relationship

2011-09-13 Thread John Fox
Dear JC, > -Original Message- > From: Jean-Christophe BOUËTTÉ [mailto:jcboue...@gmail.com] > Sent: September-13-11 9:35 AM > To: John Fox > Cc: RCulloch; r-help@r-project.org > Subject: Re: [R] Force regression line to a 1:1 relationship > > And you can easily get

Re: [R] Force regression line to a 1:1 relationship

2011-09-13 Thread David Winsemius
..@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of RCulloch Sent: September-13-11 7:03 AM To: r-help@r-project.org Subject: [R] Force regression line to a 1:1 relationship Hello, I appreciate this is likely to be an easy question. I am trying to obtain the residuals from a linear

Re: [R] Force regression line to a 1:1 relationship

2011-09-13 Thread Jean-Christophe BOUËTTÉ
y > McMaster University > Hamilton, Ontario, Canada > http://socserv.mcmaster.ca/jfox > > > >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- >> project.org] On Behalf Of RCulloch >> Sent: September-13-11 7:03 AM >> To: r-help

Re: [R] Force regression line to a 1:1 relationship

2011-09-13 Thread RCulloch
yes, that is correct. The idea being that I want to know the residuals of the data points compared to a 1:1 line (as shown in the plot), if that makes sense? I appreciate that this might not be considered a typical approach, and it would probably take a while to explain (defend) why I am doing it!

Re: [R] Force regression line to a 1:1 relationship

2011-09-13 Thread John Fox
t.org] On Behalf Of RCulloch > Sent: September-13-11 7:03 AM > To: r-help@r-project.org > Subject: [R] Force regression line to a 1:1 relationship > > Hello, > > I appreciate this is likely to be an easy question. I am trying to > obtain the residuals from a linear regression

Re: [R] Force regression line to a 1:1 relationship

2011-09-13 Thread R. Michael Weylandt
Just to clarify things before trying to answer: by a "1:1 relationship" do you mean you want the regression slope to be equal to 1 "no matter what"? Michael On Tue, Sep 13, 2011 at 7:03 AM, RCulloch wrote: > Hello, > > I appreciate this is likely to be an easy question. I am trying to obtain >

[R] Force regression line to a 1:1 relationship

2011-09-13 Thread RCulloch
Hello, I appreciate this is likely to be an easy question. I am trying to obtain the residuals from a linear regression where the line is forced to have a 1:1 relationship. An example of the data: A<-c(0.9803922, 1.3850416, 0.8241758, 0.000, 0.4672897, 1.1904762, 0.000, 0.9456265, 1.51