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
> 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:
>
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
3 matches
Mail list logo