[R-sig-eco] Using R to solve for X in cubic polynomial equations

kgorman kgorman at sfu.ca
Thu Jun 24 04:16:26 CEST 2010


Dear All, 
Thanks in advance for any guidance. I have been using the Excel Solver function to solve for unknown concentrations of hormone based on a standard curve described by a cubic polynomial question, I am trying to learn how to replicate this exercise using R.

Basically, in our hormone assay we develop a standard curve of X: known hormone standards vs Y: %B/Bo which is a value calculated based on output from a gamma counter for radioimmunoassay. The relationship between X and Y is then described as a cubic polynomial equation (for example %B/Bo=91.598+11.777*X-35.074*X^2+7.208*X^3).

When I want to solve for unknown concentrations of hormone, I take the data obtained which is %B/Bo, or Y, and solve for X based on the standard curve equation (cubic polynomial where X occurs 3-times). I have been able to do this using Excel Solver, and have been able to constrain the solution to within 2 values which fall at the extremes of my standard curve (important as there are multiple solutions).

The problem with Excel Solver is that I have to do this exercise for each unknown individually, which is very time consuming. I am sure it would be simple to write code for a loop procedure to solve for a series of unknowns.

In summary, I would like to figure out how to (1) solve for X, where Y is known, in a cubic polynomial equation when X occurs 3-times, (2) constrain the X solution to within 2 extreme values, and (3) write a loop function to solve for 78 unknown values.

I have M.J. Crawley's R Book available to me, if anyone knows of a section in there that would be helpful.

Kind regards, 
Kristen Gorman


Kristen B. Gorman
Graduate Student, PhD program

Department of Biological Sciences
Simon Fraser University
8888 University Drive
Burnaby, BC, V5A 1S6

Office: 778.782.7398
Lab:    778.782.3986
Fax:    778.782.3496
Web:    http://www.sfu.ca/~kgorman



More information about the R-sig-ecology mailing list