[R] Prediction of response after glm on whitened data

Xochitl CORMON Xochitl.Cormon at ifremer.fr
Wed Jan 28 15:08:31 CET 2015

Hi all,

Here is a description of my case. I am sorry if my question is also 
statistic related but it is difficult to disentangle. I will however try 
to make it only R applied.

My response is a growth constant "k" and my descriptor is prey biomass 
"NP" and time series is of 21 years.

I applied a gaussiam GLM (or LM) to this question. After the regression 
I tested the residuals for autocorrelation using acf(). Because 
autocorrelation was significant I decided to whiten my data using 
{car}dwt() in order to obtain rho (an estimation of my correlation) and 
then applying the following to my data in order to remove autocorrelation:
kw_i = k_i - rho * k_i-1
NPw_i = NPw_i - rho * NPw_i-1
(method from Jonathan Taylor, 

After that I fitted a model on this whitened data (kw_i ~ NPw_i), 
realised an F-test and obtained classical results such as deviance 
explained, pvalues and of course the intercept and coefficient of the 
last regression. However doing that and coming to prediction using 
predict() I can only obtained predictions of deltaK (kw_i) in function 
of deltaNP (NPw_i) but I am actually interested in being able to predict 
k in function of NP...

Is there a solution to predict directly k and its associated variance 
using R without having to detail in the script all the mathematical 
process necessary to come back to something like k_i = mu + rho * k_i-1 
+ beta(NPw_i - rho * NPw_i-1) + epsilon
with mu being the intercept, beta the regression coefficient and epsilon 
the error,

Thank you for your help,


Xochitl C.


<>< <>< <>< <><

Xochitl CORMON
+33 (0)3 21 99 56 84

Doctorante en écologie marine et science halieutique
PhD student in marine ecology and fishery science

<>< <>< <>< <><

Centre Manche Mer du Nord
150 quai Gambetta
62200 Boulogne-sur-Mer

<>< <>< <>< <><

More information about the R-help mailing list