[R] Linear system

Doran, Harold HDoran at air.org
Wed May 25 14:49:14 CEST 2005


Yes, solving systems of linear equations is a strength of R and is very
easy. Doug Bates has a nice article in a prior version of R News showing
optimal methods for doing this in R. Here is an example using your data:

X <- matrix(c(353,45,29,45,29,3,29,3,4), ncol=3)
y <- c(79,5,8)

solve(crossprod(X))%*%crossprod(X,y)

See Doug's article at the following link:

http://cran.r-project.org/doc/Rnews/Rnews_2004-1.pdf


-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Jim Gustafsson
Sent: Wednesday, May 25, 2005 8:31 AM
To: r-help at stat.math.ethz.ch
Subject: [R] Linear system


Dear R-help

I have a problem solving a linear system like

353a+45b+29c=79
45a+29b+3c=5
29a+3b+4c=8

Is there any way of doing this in R?

Best Regards
Jim


------------------------------------------------------------------------
------
This e-mail and any attachment may be confidential and may also be
privileged.
If you are not the intended recipient, please notify us immediately and
then delete this e-mail and any attachment without retaining copies or
disclosing the contents thereof to any other person.
Thank you.
------------------------------------------------------------------------
------
	[[alternative HTML version deleted]]

______________________________________________
R-help at 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




More information about the R-help mailing list