Displaying 1 result from an estimated 1 matches for "oldlev".
Did you mean:
oldlen
2005 Aug 24
0
Model forecasts with new factor levels - predict.warn
...message("there are ",dnn," factor names ")
dostop<-FALSE # Ensure the return value is defined
for (i in seq(along=nn)) {
message("Factor ",nn[i]," in estimation data")
ofac <- object[["model"]][[nn[i]]]
print(ofac) # diagnostic
oldlev<-levels(factor(ofac))
nfac <- newdata[[nn[i]]] # ?? note need for double brackets. Why?
message("Factor ",nn[i], " in new data")
print(nfac) # diagnostic
message("about to try levels on newfac")
newlev<-levels(factor(nfac))
for (j in seq(alon...