**From:** Darren Shaw (*Darren.Shaw@ed.ac.uk*)

**Date:** Fri 14 May 2004 - 20:11:07 EST

**Next message:**Ramzi TEMANNI: "[R] quadratic problem with quadratic constraint"**Previous message:**Prof Brian Ripley: "Re: [R] Problem with logtrans, from library MASS"**Next in thread:**Douglas Bates: "Re: [R] NLME model question"**Reply:**Douglas Bates: "Re: [R] NLME model question"**Reply:**kjetil@acelerate.com: "Re: [R] NLME model question"

Message-id: <5.1.0.14.2.20040514110535.00b80c70@staffmail.ed.ac.uk>

Dear R-helpers

I have a problem related to the use of NLME

I think is simply a matter of getting the nlme coding correct, but i cannot

get my brain around it

I am analysing some 24 growth curves of some cells , and i wanted to say

that there are significant differences between the curves in two parameters

that describe the pattern of growth. these parameters are from a logistic

(r & k) .

i have attempted to construct a self starting routine for nlme ie:

SSGrowth_function(x, r, k)

{

.expr2 <- (k - 100000)/100000

.expr5 <- exp(((r * -1) * x))

.expr7 <- 1 + (.expr2 * .expr5)

.expr13 <- .expr7^2

.value <- k/.expr7

.actualArgs <- match.call()[c("r", "k")]

if(all(unlist(lapply(as.list(.actualArgs), is.name)))) {

.grad <- array(0, c(length(.value), 2), list(NULL, c("r",

"k")))

.grad[, "r"] <- - ((k * (.expr2 * (.expr5 * (-1 *

x))))/.expr13)

.grad[, "k"] <- (1/.expr7) - ((k * (1e-005 * .expr5))/.expr13)

dimnames(.grad) <- list(NULL, .actualArgs)

attr(.value, "gradient") <- .grad

}

.value

}

where x = time, 100000 = known starting conditions, r = growth and k =

carrying capacity

i guessed i should then write

nlme(NoofCells~SSGrowth(Time,r,k),fixed=r+k~1,data=CellData,random=r+k~1)

This runs and tells me that r & k's do differ

BUT. The "CellData" actually consists of replicates - ie there are 4 cell

types, but they are done 6 times each. Therefore, I do not want to ask if

there are significant differences in r & k between 24 sets of data

("Runs")- rather I want to be able to say that there are differences

between the four cell types occurring 6 times each. So how do

i incorporate "CellType" explicitly into my model structure??

i.e. If i was lust looking at say linear growth and was using lme I would

have written something like

lme(NoofCells~Time*CellType,random=~1|Runs,data=CellData)

Any thoughts/suggestions gratefully received

Darren Shaw

-----------------------------------------------------------------

Dr Darren J Shaw

Centre for Tropical Veterinary Medicine (CTVM)

Royal School of Veterinary Studies

The University of Edinburgh

Scotland

______________________________________________

R-help@stat.math.ethz.ch mailing list

https://www.stat.math.ethz.ch/mailman/listinfo/r-help

PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

**Next message:**Ramzi TEMANNI: "[R] quadratic problem with quadratic constraint"**Previous message:**Prof Brian Ripley: "Re: [R] Problem with logtrans, from library MASS"**Next in thread:**Douglas Bates: "Re: [R] NLME model question"**Reply:**Douglas Bates: "Re: [R] NLME model question"**Reply:**kjetil@acelerate.com: "Re: [R] NLME model question"

*
This archive was generated by hypermail 2.1.3
: Mon 31 May 2004 - 23:05:10 EST
*