Skip to content

nlme book

2 messages · Dominick Samperi, Andrew Robinson

#
Hello,

I'm having trouble getting one of the examples from Pinheiro
and Bates working and I wonder if somebody can help?
Maybe this is an R/S compatibility issue?

Following the Dialyzer example on pp. 255-260 I tried:

fm1Dial.gls <- gls(rate ~ (pressure + I(pressure^2) + I(pressure^3) +
I(pressure^4))*QB, Dialyzer)

fm2Dial.gls <- update(fm1Dial.gls, weights = varPower(form = ~ pressure))

fm3Dial.gls <- update(fm2Dial.gls, correlation = corAR1(0.771, form =
~ 1 | Subject))

plot(ACF(fm3Dial.gls, form = ~ 1 | Subject), alpha = 0.01)

The problem is the plot still shows significant autocorrelations at
lags 1 and 2, like Figure 5.20 on P. 258, and not like the
autocorrelation-free Figure 5.21 on P. 260.

Thanks,
Dominick
#
Hi Dominick,

try

plot(ACF(fm3Dial.gls, form = ~ 1 | Subject, resType="n"), alpha = 0.01)

which asks R to normalize the covariance matrix of the residuals by
transformation (according to the model) before computing the ACF.

Cheers

Andrew
On Mon, Apr 11, 2011 at 12:42:22AM -0400, Dominick Samperi wrote: