[R] Regression

Paul Hiemstra p.hiemstra at geo.uu.nl
Sat Jan 31 12:11:56 CET 2009


Edwin Wibisono wrote:
> Hello, I have problem
> I have a, and b in regression
> then I can't plot x,y with (and) a, b lines
>
> can you help me ?
>
> thx
>
> 	[[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.
>   
I think what you want is something like:

x = data.frame(a = runif(100), b = rnorm(100))
lmobj = lm(b~a, x)
plot(b~a, x)
abline(lmobj)

cheers,
Paul

-- 
Drs. Paul Hiemstra
Department of Physical Geography
Faculty of Geosciences
University of Utrecht
Heidelberglaan 2
P.O. Box 80.115
3508 TC Utrecht
Phone: 	+31302535773
Fax:	+31302531145
http://intamap.geo.uu.nl/~paul




More information about the R-help mailing list