From: Rand, Hugh <rand_at_amgen.com>

Date: Sat 18 Feb 2006 - 08:44:41 EST

R-help@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 Received on Sat Feb 18 08:50:08 2006

Date: Sat 18 Feb 2006 - 08:44:41 EST

Works perfectly. Thank you.

-Hugh Rand

> exp(coef(model3$modelStruct$varStruct)["const"])

Non-visible functions are asterisked

const power

0.6551298 0.8913665

Answer the questions? spencer graves

Rand, Hugh wrote:

> I have been using gnls with the weights argument (and varConstPower) to

*> specify a variance structure for curve fits. In attempting to extract the
**> parameters for the variance model I am seeing results I don't understand.
**> When I simply display the model (or use "summary" on the model), I get
*

what

> seem like reasonable values for both "power" and "const". When I actually

*> try to extract the values, I get the same number for the "power", but a
**> different (and less sensible) value for "const".
**>
**> The simplest example I can come up with that shows the problem is as
**> follows:
**>
**>
**> #Set up data
**>
**> x = c(0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7);
**> y0 = c(.1,.1,.1, .5,.5,.5, 1,1,1, 2,2,2, 4,4,4, 7,7,7, 9,9,9, 10,10,10);
**> yp = c(0,.03,.05, 0,.05,.01, 0,.07,.03, .1,0,.2, .2,.1,0, .3,0,.1,
**> 0,.3,.4, .3,.5,0);
**> y = y0 + 4*yp;
**> data = data.frame(x=x,y=y);
**>
**> #Run model
**>
**> library(nlme)
**> model3 = try(gnls(y ~
*

>

SSfpl(x,A,B,xmid,scal),data=data,weights=varConstPower(const=1,power=0,form=

> ~fitted(.))));

*>
**> #Examine results
**>
**> model3; #const = .6551298, power
*

=

> .8913665

*> summary(model3); #const = .6551298, power
*

=

> .8913665

*>
**> coef(model3$modelStruct$varStruct)["power"]; # power
*

=

> .8913665

*> coef(model3$modelStruct$varStruct)["const"]; #const = -0.4229219
**> coef.varFunc(model3$modelStruct$varStruct); #R can't seem to find this
**> function, Splus can
**>
**>
**> Any advice on what I am doing wrong would be appreciated.
**>
**> Hugh Rand
**> Senior Scientist
**> Amgen
**> rand@amgen.com
**>
**> ______________________________________________
**> R-help@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

R-help@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 Received on Sat Feb 18 08:50:08 2006

*
This archive was generated by hypermail 2.1.8
: Mon 20 Feb 2006 - 14:08:40 EST
*