[R] cv.glm {boot}

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Mar 15 08:05:49 CET 2005


On Mon, 14 Mar 2005, Trevor Wiens wrote:

> I am try to cross validate some logistic regressions. cv.glm allows me 
> to do this randomly but since I have data over a number of years and 
> over a number of distince areas, I would like to cross-validate 
> temporarly and spatially. I've already attached the temporal and spatial 
> attributes to my data, but I'm unsure as to how to achieve this, as it 
> seems I can't use cv.glm for this purpose.

Cross-validation assumes exchangeability of units.  You can easily write 
your own code (lots of examples in MASS), but first you would need to 
prove the validity of what you are attempting.  For example, dropping 
chunks in the middle of a time series is not valid unless your prediction 
somehow takes the temporal structure into account (and glm does not).

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list