[S] nls and factors

Tue, 23 Jun 1998 18:08:00 -0400

From: Karen Johnson@BDX on 06/23/98 06:08 PM
This is my first time using nls(). I will do my best to keep
this succinct and still capture the problem.

As blood in a tube is centrifuged, the blood separates with serum
on top. The experiment measured the percent serum during
centrifuge for 10 subjects, with measurements taken initially and
every 10 seconds for 10 minutes (10 subjects x 61 measurements
per subject).

Graphing the data shows that the curve family
serum ~ bo - b1 * exp( -b2 * time)
is a reasonable model. The asymptote, defined by b0, varies
widely by subject (35 to 55%), but the time till the curve
flattens outs looks consistent (somewhere between 4 and 5
The goal is to determine the how long until the curve flattens
out to create a criterion for evaluating new systems. (Say
flattening is defined by the time until the serum percentage
achieves 98% of its final value.)
To answer this question I would like to fit a curve family where
b0 and possibly b1 vary per donor, but b2 is general to all
So far I can fit separate models for each donor, but have been
unable to make a general model.
There is an example in the S+ 4.5 manual using the Puromycin data
set where the variable 'state' is a factor, but the factor only
has two levels and is converted to 0's and 1's.
My questions are
* Do I need to create a matrix with the 9 dummy variables
expressly defined?, if so are there any concerns getting nls() to
accept a matrix in the formula?
* Should I be using a different tool or approach?

I'm using S+ 4.5 on an NT machine and have the contrasts for
donor defined by contr.treatment. I would be glad to post a
summary to the list.

Thanks for your help,
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news