Re: [R] replacement has *** rows, data has ***

2017-06-12 Thread William Dunlap via R-help
This can happen if there are rows containing missing values (NA's) in the data used to fit the model. Use na.action=na.exclude when fitting the model instead of the default na.action=na.omit to make the prediction vector line up with the input data instead of lining up with the input data after

Re: [R] replacement has *** rows, data has ***

2017-06-12 Thread David Winsemius
> On Jun 12, 2017, at 1:32 PM, Manqing Liu wrote: > > Hi all, > > I created a predicted variable based on a model, but somehow not all > observations have a predicted value. When I tired to add the predicated > value to the main data set (data$pr <- pr) , it said: >

[R] replacement has *** rows, data has ***

2017-06-12 Thread Manqing Liu
Hi all, I created a predicted variable based on a model, but somehow not all observations have a predicted value. When I tired to add the predicated value to the main data set (data$pr <- pr) , it said: replacement has 34333 rows, data has 34347. Do you know how to solve that? Thanks, Manqing