On Tue, Sep 16, 2003 at 11:44:02AM -0500, Peter Whiting wrote: > > I'm not sure how to identify the cities in nconst that are not > modeled by g (my actual model has many more predictors in the > formula)
I guess I could use some form of subset(const,const$city%in%g$xlevels$city) over and over again for each factor... as usual, there has to be a better way. pete > Is there a way to instruct predict to only predict the > rows for which it has enough information and not complain about > the others? > > g<-lm(days~city,data=const) > x<-predict(g,nconst) ## the rows of x with city=ALBANY will be NA > g<-lm(days~state,data=const) > y<-predict(g,nconst) > x[is.na(x)]<-y[is.na(x)] > > thanks, > pete > > ______________________________________________ > [EMAIL PROTECTED] mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
