Catriona Hendry
2012-Nov-25 00:27 UTC
[R] Comparing linear regression coefficients to a slope of 1
Hi! I have a question that is probably very basic, but I cannot figure out how to do it. I simply need to compare the significance of a regression slope against a slope of 1, instead of the default of zero. I know this topic has been posted before, and I have tried to use the advice given to others to fix my problem. I tried the offset command based on one of these advice threads as follows: Regression <- lm(y~x+offset(1*x)) but this resulted in a regression line that was plotted perpendicular to the data when added with the abline function. I would be extremely grateful for your help!! Thanks!! Cat [[alternative HTML version deleted]]
Albyn Jones
2012-Nov-25 01:15 UTC
[R] Comparing linear regression coefficients to a slope of 1
Is this homework? PLEASE do read the posting guide http://www.R-project.org/posting-guide.html albyn On Sat, Nov 24, 2012 at 07:27:25PM -0500, Catriona Hendry wrote:> Hi! > > I have a question that is probably very basic, but I cannot figure out how > to do it. I simply need to compare the significance of a regression slope > against a slope of 1, instead of the default of zero. > > I know this topic has been posted before, and I have tried to use the > advice given to others to fix my problem. I tried the offset command based > on one of these advice threads as follows: > > Regression <- lm(y~x+offset(1*x)) > > but this resulted in a regression line that was plotted perpendicular to > the data when added with the abline function. > > I would be extremely grateful for your help!! > > Thanks!! > > Cat > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Albyn Jones Reed College jones at reed.edu
Bert Gunter
2012-Nov-25 01:22 UTC
[R] Comparing linear regression coefficients to a slope of 1
1. The model is correct : lm( y~ x + offset(x)) ( AFAICS) 2. Read the posting guide, please: Code? I do not know what you mean by: " this resulted in a regression line that was plotted perpendicular to the data when added with the abline function." Of course, maybe someone else will groc this. 3. I wonder if you really want to do what you are doing, anyway. For example, in comparing two assays to see whether they give "similar" results, you would **not** do what you are doing. If you care to follow up on this, I suggest you post complete context to a statistical mailing list, not here, like stats.stackexchange .com. Also, feel free to ignore me, of course. I'm just guessing. Cheers, Bert Cheers, Bert On Sat, Nov 24, 2012 at 4:27 PM, Catriona Hendry <hendry@gwmail.gwu.edu>wrote:> Hi! > > I have a question that is probably very basic, but I cannot figure out how > to do it. I simply need to compare the significance of a regression slope > against a slope of 1, instead of the default of zero. > > I know this topic has been posted before, and I have tried to use the > advice given to others to fix my problem. I tried the offset command based > on one of these advice threads as follows: > > Regression <- lm(y~x+offset(1*x)) > > but this resulted in a regression line that was plotted perpendicular to > the data when added with the abline function. > > I would be extremely grateful for your help!! > > Thanks!! > > Cat > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm [[alternative HTML version deleted]]
David Winsemius
2012-Nov-25 01:31 UTC
[R] Comparing linear regression coefficients to a slope of 1
On Nov 24, 2012, at 4:27 PM, Catriona Hendry wrote:> Hi! > > I have a question that is probably very basic, but I cannot figure > out how > to do it. I simply need to compare the significance of a regression > slope > against a slope of 1, instead of the default of zero. > > I know this topic has been posted before, and I have tried to use the > advice given to others to fix my problem. I tried the offset command > based > on one of these advice threads as follows: > > Regression <- lm(y~x+offset(1*x)) > > but this resulted in a regression line that was plotted > perpendicular to > the data when added with the abline function. >If the slope were in fact == 1 then what would the offset need to be to "correct it" so that it were == 0? Failing this effort at clapping one hand, then please produce the requested dataset and other bits of window dressing requested in the Posting Guide, including whether this is a homework problem and what your academic institution's expectations are for soliciting help over the Internet. -- David Winsemius, MD Alameda, CA, USA