Dear help-list, I would like to perform a linear regression on the log10 of the two vectors ov.mag.min and res.600nm. The slope and intercept of the regression I use to plot a wider range of ov.mag.min in a double log plot.
For a linear regression on only tow points, wouldn't I expect the results for two.points.min to match pretty exactly res.600nm? It does not seem to be the case here. I manually calculated the slope and intercept and got values of -0.71 and 1.5 that seem to work alright. What is it that I am missing here? Thanks already for your help, Kim ov.mag.min <- c(50, 1000) res.600nm <- c(2.0, 0.231) lm.line.min <- lm( log(ov.mag.min,10) ~ log(res.600nm,10) ) intercept.min <- lm.line.min$coefficients[1] slope.min <- lm.line.min$coefficients[2] two.points.min <- log(ov.mag.min,10) round(res.600nm,2) == round(10^(two.points.min*slope.min+intercept.min),2) round(res.600nm,2) round(10^(two.points.min*-0.71+1.5),2) __________________________________________ Kim Milferstedt University of Illinois at Urbana-Champaign Department of Civil and Environmental Engineering 4125 Newmark Civil Engineering Laboratory 205 North Mathews Avenue MC-250 Urbana, IL 61801 USA phone: (001) 217 333-9663 fax: (001) 217 333-6968 email: [EMAIL PROTECTED] http://cee.uiuc.edu/research/morgenroth ______________________________________________ R-help@stat.math.ethz.ch 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.