<p><!--begin_signature-->Hi,</p>
<p>I'm getting this error message when I run my projections on future climate data:</p>
<p>In predict.lm(object, newdata, se.fit, scale = 1, type = ifelse(type == ... :<br />
prediction from a rank-deficient fit may be misleading</p>
<p>I wonder if anyone can help? I paste my code below.</p>
<p>Many thanks,</p>
<p>Raquel </p>
<p><br /></p>
<div>### CALIBRATION AND VALIDATION ##############################</div>
<div><br />path <- "C:/Raquel_Garcia/fourthRun"</div>
<div>taxa <- c("frogs","snakes","mammals","birds")</div>
<div>library(BIOMOD)<br />source("C:/Raquel_Garcia/ModelsH.r")<br />source("C:/Raquel_Garcia/thirdRun/Ensemble.Forecasting.r")</div>
<div>clim <- c("clust1_4160a2", "clust2_4160a2", "clust3_4160a2", "clust1_4160a1b",<br />"clust2_4160a1b", "clust3_4160a1b", "clust1_4160b1", "clust2_4160b1", <br />
"clust3_4160b1", "clust1_8100a2", "clust2_8100a2", "clust3_8100a2", <br />"clust1_8100a1b", "clust2_8100a1b", "clust3_8100a1b", "clust1_8100b1", <br />
"clust2_8100b1", "clust3_8100b1")</div>
<div> </div>
<div>for (tx in 1:4)<br /> {<br />#dir.create(paste(path, taxa[tx], sep="/"))<br />taxapath <- paste(path, taxa[tx],sep="/")</div>
<div><br />### CALIBRATION ################################################################</div>
<div>setwd(paste(path,"Data",sep="/"))</div>
<div>species<-read.table(paste(taxa[tx],"_1851cells_spp15.txt",sep=""),h=T,sep="\t") <br />sppnames <- names(species)</div>
<div>clim6190<-get(load("var6190_1851cells_3var")) # present climate table</div>
<div>coor<-read.table(paste("coorXY_1851cells.txt",sep=""),h=T,sep="\t") <br />coorXY <- coor[,2:3]<br /> </div>
<div><br />for (f in 1:length(sppnames))<br /> {<br /> dir.create(paste(taxapath, "/", sppnames[f], sep=""))</div>
<div> setwd(paste(taxapath, "/", sppnames[f], sep=""))</div>
<div> <br /> Initial.State(Response=species[,f], Explanatory=clim6190[,4:6], IndependentResponse=NULL, IndependentExplanatory=NULL,<a target="_blank" href="http://sp.name/">sp.name</a>=sppnames[f])</div>
<div> ModelsH(GLM = T, TypeGLM = "poly", Test = "AIC", GBM = T, No.trees = 2000, GAM = T,<br /> Spline = 3, CTA = F, CV.tree = 50, ANN = T, CV.ann = 5, SRE = F, q=0.0025, FDA = T,<br /> MARS = T, RF = T, NbRunEval = 5, DataSplit = 75, Yweights=NULL, Roc = T, Optimized.Threshold.Roc = T,<br />
Kappa = F, TSS=T, KeepPredIndependent = F, VarImport=5, NbRepPA=2, strategy="random",<br /> coor=coorXY, nb.absences=1/3(dim(species)[1]))</div>
<div> </div>
<div># saving Pseudo-Absence data </div>
<div>save(Biomod.PA.data, file=paste(Biomod.material$species.names, "PAdata", sep="_"))<br />save(Biomod.PA.sample, file=paste(Biomod.material$species.names, "PAsample", sep="_"))</div>
<div> </div>
<div>### PREDICTIONS ################################################################</div>
<div> #Predictions on the original dataset <br /> <br /> CurrentPred(GLM=T, GBM=T, GAM=T, CTA=F, ANN=T, SRE=F, FDA=T, MARS=F, RF=T,<br /> BinRoc=T, BinKappa=F, BinTSS=T, FiltKappa=F)</div>
<div> PredictionBestModel(GLM=T,GBM=T, GAM=T, CTA=F, ANN=T, FDA=T, MARS=F, RF=T, SRE=F,<br /> method='all', Bin.trans = T, Filt.trans = T)</div>
<div> </div>
<div># saving evaluation results</div>
<div> save(Evaluation.results.TSS,file=paste("eval.TSS","_",Biomod.material$species.names,sep=""))<br /> save(Evaluation.results.Roc,file=paste("eval.ROC","_",Biomod.material$species.names,sep=""))</div>
<div><br /># saving VarImportance<br /> <br /> save(VarImportance,file=paste("VarImportance","_",Biomod.material$species.names,sep=""))</div>
<div><br />### CURRENT PROJECTIONS #########################################################</div>
<div> <br /> Projection(Proj = clim6190[,4:6], Proj.name='CurrentF',<br /> GLM = T, GBM = T, GAM = T, CTA = F, ANN = T, SRE = F, q=0.0025, FDA =T, MARS = T,<br /> RF = T, BinRoc=T, BinKappa=F, BinTSS=T, FiltRoc=T, FiltKappa=F, FiltTSS=T, repetition.models=T)</div>
<div> Ensemble.Forecasting(Proj.name= "CurrentF", weight.method='TSS', PCA.median=T,<br /> binary=T, bin.method='TSS', Test=T, decay=1.6, repetition.models=T, final.model.out=F)</div>
<div> </div>
<div>### FUTURE PROJECTIONS #########################################################</div>
<div> for (d in 1:18) <br /> {<br /> future <- read.table(paste(datapath, "/", clim[d], "_3var.txt", sep=""), header=T, sep="\t")</div>
<div> Projection(Proj = future, Proj.name=paste(clim[d],"F",sep=""), GLM = T, GBM = T, GAM = T,<br /> CTA = F, ANN = T, SRE = F, q=0.0025, FDA =T, MARS = T, RF = T,<br /> BinRoc = T, BinKappa = F, BinTSS = T, FiltRoc = T, FiltKappa = F, FiltTSS = T,<br />
repetition.models=T)</div>
<div> ProjectionBestModel(Proj.name=paste(clim[d],"F",sep=""), Bin.trans=T, Filt.trans=T, method='all')</div>
<div> </div>
<div>### ENSEMBLE FORECASTING (SDMs) ################################################</div>
<div> Ensemble.Forecasting(Proj.name= paste(clim[d],"F",sep=""), weight.method='TSS', PCA.median=T,<br /> binary=T, bin.method='TSS', Test=T, decay=1.6, repetition.models=T, final.model.out=F)<br />
}</div>
<div> </div>
<div>### CLEANING UP ################################################################</div>
<div><br /># saving workspace </div>
<div>save.image(file=paste(sppnames[f],"_workspace.RData",sep=""))</div>
<div> <br /># remove objects not needed </div>
<div> t= c("path", "taxapath", "datapath", "sppnames", "varlist",
"species", "clim6190", "coorXY", "ModelsH", "Ensemble.Forecasting")
<br />
Rem = ls()<br /> rm(list=(Rem[<a target="_blank" href="http://is.na/">is.na</a>(match(Rem, t))]))<br /> <br /> }<br />} </div> <br />
<p>................<br />
Raquel A. Garcia<br />
Integrative Biology and Global Change Group<br />
www.ibiochange.mncn.csic.es<!--end_signature--></p>