Re: [R] Plotting confidence bands around regression line

2011-02-10 Thread dtholmes
Here is my primitive and computationally intensive solution to this problem. Thank you to Michal (see above) for making me aware of the nice polygon function. I am sure that there are better solutions but this one works for me at work and for publication. ###

Re: [R] Plotting confidence bands around regression line

2010-08-11 Thread Frank Harrell
I may be missing something but I don't see how P&B handles errors in variables any differently than other regression methods that ignore this problem. Frank Frank E Harrell Jr Professor and ChairmanSchool of Medicine Department of Biostatistics Vanderbilt Uni

Re: [R] Plotting confidence bands around regression line

2010-08-11 Thread S Ellison
>>> Frank Harrell 11/08/2010 17:02:03 >>> > This problem seems to cry out for one of the many available robust > regression methods in R. Not sure that would be much more appropriate, although it would _appear_ to work. The P&B method is a sort of nonparametric/robust approach to an errors-in

Re: [R] Plotting confidence bands around regression line

2010-08-11 Thread Frank Harrell
Frank E Harrell Jr Professor and ChairmanSchool of Medicine Department of Biostatistics Vanderbilt University On Wed, 11 Aug 2010, Michal Figurski wrote: Peter, Frank, David and others, Thank you all for your ideas. I understand your lack of trust in P&B meth

Re: [R] Plotting confidence bands around regression line

2010-08-11 Thread Michal Figurski
Peter, Frank, David and others, Thank you all for your ideas. I understand your lack of trust in P&B method. Setting that aside (it's beyond me anyways), please see below what I have finally came up with to calculate the CI boundaries. Given the slope and intercept with their 05% & 95% CIs, an

Re: [R] Plotting confidence bands around regression line

2010-08-11 Thread peter dalgaard
On Aug 10, 2010, at 8:23 PM, Michal Figurski wrote: > Peter, > > Since in P&B the procedure is to calculate a whole list of slopes and > intercepts, wouldn't it be a solution to determine the correlation and go > from there? How do I do it? You can't. (Perhaps someone could, but it looks like

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread Frank Harrell
Thanks Michael, That's the method that Dana Quade taught me in his intro nonparametrics course at UNC in the mid 1970s, at least for a single predictor. His method did not incorporate the shift you mentioned though. The method looks robust. Not sure about efficiency. Frank Frank E Harr

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread Michal Figurski
Peter, Since in P&B the procedure is to calculate a whole list of slopes and intercepts, wouldn't it be a solution to determine the correlation and go from there? How do I do it? -- Michal J. Figurski, PhD HUP, Pathology & Laboratory Medicine Biomarker Research Laboratory 3400 Spruce St. 7 Ma

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread Michal Figurski
Frank, I had to order this article through Inter-Library Loan and wait for it for a week! I'll try to make it short. In Passing-Bablok the principle is to calculate slopes between all possible pairs of points in the dataset, and then to take a "shifted" median of those slopes, where the offs

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread Peter Dalgaard
Michal Figurski wrote: > # And the result of the Passing-Bablok regression on this data frame: > Estimate 5%CI 95%CI > Intercept -4.306197 -9.948438 -1.374663 > Slope 1.257584 1.052696 1.679290 > > The original Passing & Bablok article on this method has an easy > pre

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread David Winsemius
On Aug 10, 2010, at 12:12 PM, Michal Figurski wrote: David, I would consider myself intermediate in R, but a beginner in statistics. I need a formula that would allow me to calculate confidence boundaries of the regression line given the slope, intercept and their CIs (and *any* range).

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread Frank Harrell
Please give the prescription. The article is not available on our extensive online library. I wonder if the method can compete with the bootstrap. Frank Frank E Harrell Jr Professor and ChairmanSchool of Medicine Department of Biostatistics Vanderbilt Unive

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread Michal Figurski
David, I would consider myself intermediate in R, but a beginner in statistics. I need a formula that would allow me to calculate confidence boundaries of the regression line given the slope, intercept and their CIs (and *any* range). Passing-Bablok regression doesn't yet exist in R - I am d

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread David Winsemius
On Aug 10, 2010, at 11:23 AM, Michal Figurski wrote: David, I may have stated my problem incorrectly - my problem is to *obtain the coordinates* for confidence boundary lines. As input data I have only CIs for slope and intercept. Wouldn't you also need to specify the range over which th

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread Michal Figurski
David, I may have stated my problem incorrectly - my problem is to *obtain the coordinates* for confidence boundary lines. As input data I have only CIs for slope and intercept. rms/Hmisc packages are very nice, but unfortunately they do not work with Passing-Bablok nor 'nls' models. -- Mi

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread David Winsemius
On Aug 10, 2010, at 10:56 AM, Michal Figurski wrote: Dear R-helpers and graphics gurus, I have two problems with plotting confidence bands: 1. First is relatively simple. I am using the Passing-Bablok procedure to obtain "unbiased" regression coefficients. This procedure yields the "a" &

[R] Plotting confidence bands around regression line

2010-08-10 Thread Michal Figurski
Dear R-helpers and graphics gurus, I have two problems with plotting confidence bands: 1. First is relatively simple. I am using the Passing-Bablok procedure to obtain "unbiased" regression coefficients. This procedure yields the "a" & "b" coefficient values along with their confidence interva