I'm formulating a prediction in a logistic reression type in a GAM model.

model1 <- gam(hi.lo.arousal ~ s(time) + s(mssd) + s(sum10days),
              family = binomial)

I wish to predict high arousal in bipolar patients, on the basis of earlier arousal. I have daily Hi/lo measures of arousal in a timeseries. These are made from variables coded 0-5 and then transformed to be hi or lo ((4 or more vs. less than 4) instead. The covariates I wish to use in my model is time spent in treatment, variability in scores (root of mean succesive squared differences), summation of the 0-5 values in arousal over the last 10 days. In formulating my model, in a way I wish to use the autocorrelation as a predictor. Im wondering if I recode my variables in a way that I in each row get summed values of the previous 10 rows (a window of the last 10 days) would I be smoothing she smooth, or is this ok to do this mathematically when making a gam? My thinking is: The covariates I use will give me an indication of whether patient time spent in therapy, previous variability in emotion & previous "pain" last ten days has a say in whether my patients loose their temper.The following days.


1 Answer 1


Since the question has been pending for som days now, I'll answer as far as I hav got for now: 1) The smoothing of the smooth is probably not a problem since I can control the wigglyness of the curve by degrees of freedom / number of "knots" on the smoothed curve. 2) I can read the degree of autocorrelation in the p-value returned for the sum of "TRUE"-answers (level is 4 or above) over the last 10 days.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.