[R] abline of an lm fit not correct

Patrick Connolly p_connolly at slingshot.co.nz
Thu Dec 13 20:07:16 CET 2012


Easting and northing data uses numbers requiring more digits than R's
default of 7.  In all the years I've used R, the only time I've needed
to adjust the default digits is with easting and northing data.

Try something like

options(digits = 11)


HTH

On Thu, 13-Dec-2012 at 03:22PM +0000, 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]]
|> 

|> ______________________________________________
|> 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.


-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___    Patrick Connolly   
 {~._.~}                   Great minds discuss ideas    
 _( Y )_  	         Average minds discuss events 
(:_~*~_:)                  Small minds discuss people  
 (_)-(_)  	                      ..... Eleanor Roosevelt
	  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.




More information about the R-help mailing list