[R] nlme function in S+ and R
d.lee at stat.ubc.ca
d.lee at stat.ubc.ca
Thu May 15 21:19:12 CEST 2008
Greetings and Salutations,
I was curious if anyone out there has had much experience with the nlme function
in both S+ and R. Right now I am working on an HIV dataset and trying to fit a
NLME model to the data, and the coefficients I get in S+ differ slightly from
the coefficients in R:
R model : 12.44 0.84 39.07 10.70 4.48 7.48 0.60 1.85 0.18
S model : 12.45 0.59 36.65 1.07 5.46 7.59 0.35 1.92 0.20
Since there is a random component, I expect there to be some deviations from one
another, but as you can see the coefficients for the 4th variable are just too
different from one another and hence my concern. The S+ code I am using is:
fit4 <- try(nlme(lgcopy ~ logexp2(p1,b1,p2,b2,day),
fixed = list(p1 ~tnf, b1 ~tnf+cd4coun, p2~tnf,b2~basech50),
random = list(p1 ~ .,b1 ~.,p2~.,b2~.),
cluster = ~ patid,
data = completedata,
start = list(fixed=start0)
)
)
and, I believe, I made the appropriate adjustments for R:
fit4 <- try(nlme(lgcopy ~ logexp2(p1,b1,p2,b2,day),
fixed = list(p1 ~tnf, b1 ~tnf+cd4coun, p2~tnf,b2~basech50),
random = list(p1+b1+p2+b2~1),
groups = ~ patid,
data = completedata,
start = list(fixed=start0)
)
)
If anyone could lend some insight to this difference, it would be very much
appreciated. Cheers.
Sincerely
- Derrick
Derrick Lee, MSc Candidate
Department of Statistics
The University of British Columbia
LSK-314A | 604 - 822 - 1299 x532
d.lee at stat dot ubc dot ca | dgylee at mun dot ca
www.stat.ubc.ca/~d.lee/ | www.math.mun.ca/~derrick0/
More information about the R-help
mailing list