length of Inverse Mills ratio is different from the original dataset

I realized that the difference in number of observations exactly equals the number of rows with missing values in the data set. I dropped the missing values and repeated the code. This time it worked:

library(stats) # for probit regression
library(sampleSelection) # for inverse Mills ratio

surviveprobit <- glm(survive ~ ldnpt_1+ldrst_1+ldinv_1,
family = binomial(link = "probit"),
data = pfe1)

pfe2 <- drop_na(pfe1)
pfe2$imr1 <- invMillsRatio(surviveprobit)$IMR1 # inverse Mills ratio