The key to using cv.glm is that you have to have a fitted model object with all the data to validate. In your case, that would appear to be a model like this: lm(base[,ncol(base)]~NDI) where NDI is calculated from two bands in the dataframe base. However, if the ground truth data is independently collected from the imagery (the usual case), then there is no need to do cross validation - the model above is all you need? If you repeat the model above for all pairwise combinations of bands, then comparing the models using R^2 or some other metric would tell you which band combination is superior.
Cheers On Tue, Apr 10, 2012 at 6:01 AM, Motte <christine.wal...@gmx.de> wrote: > Hey all, > > I need some help with a cross validation. I'm new with R and as well with > statistics. I had a group work to create a tool for remote sensing class > that extracts the best bands of hyperspectral satellite images that > describe > vegetation. Its a regression between a linear function of using a > normalized > differenced index (i-j)/(i+j) while i and j are the bands (in the data > these > are the columns, expect the last column) and the ground truth data which is > listed in the last column in %. > We did a manual cross validation (described below), but as the code is too > long and confusing, we'd like to use the cv.glm function out of the boot > package. We've tried it several times, but we don't know how to do ist. > Could anybody help us? > This is our current code for the tool with a manual cross validation: > > > Thanks a lot, > Motte > > -- > View this message in context: > http://r.789695.n4.nabble.com/Package-boot-funtion-cv-glm-tp4545275p4545275.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Drew Tyre School of Natural Resources University of Nebraska-Lincoln 416 Hardin Hall, East Campus 3310 Holdrege Street Lincoln, NE 68583-0974 phone: +1 402 472 4054 fax: +1 402 472 2946 email: aty...@unl.edu http://snr.unl.edu/tyre http://aminpractice.blogspot.com http://www.flickr.com/photos/atiretoo [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.