You don't provide a reproducible example, but my first guess is that the
print method is rounding what appears on the screen, so you aren't actually
using the slope and intercept. See ?print.default and the digits argument
under ?options for more.

Why do you need to copy and paste the coefficients? Just to check
your understanding?

Sarah

On Thursday, December 13, 2012, Robert U wrote:

> Hello fellow
> R-users,
>
> I’m stuck
> with something i think is pretty stupid, but i can’t find out where i’m
> wrong,
> and it’s turning me crazy!
>
> I am doing
> a very simple linear regression with Northing/Easting data, then I plot the
> data as well as the regression line :
>
> > plot(x=Dataset$EASTING,
> y=Dataset$NORTHING)
> > fit <- lm(formula = NORTHING ~ EASTING,
> data = Dataset)
> > abline(fit)
> > fit
>
> Call:
> lm(formula = NORTHING ~ EASTING, data =
> Dataset)
>
> Coefficients:
> (Intercept)      EASTING
>   5.376e+05    4.692e-02
>
> Later on, when I use the
> command “abline” with the coefficient provided by “summary(fit)”, the line
> is
> not the same as abline(fit) !
>
> To summarize,
> those two lines are different:
>
> > abline(fit)
> >
> abline(5.376e+05, 4.692e-02)
>
> The “b” coefficients
> appear equal, but the intercepts are different.
>
> Where am I missing
> something? L
>
> Thanks
>         [[alternative HTML version deleted]]
>
>

-- 
Sarah Goslee
http://www.stringpage.com
http://www.sarahgoslee.com
http://www.functionaldiversity.org

        [[alternative HTML version deleted]]

______________________________________________
[email protected] 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.

Reply via email to