Can I use the variable given in my dataset to create a new variable? Background: I have a data set that has lot of missing values so for each observation i would like to give a score on how many field's the person has input, my hypothesis is that higher the no of fields he inputs, higher is his chance of getting converted.
I'm trying to build a scoring model. I have around 10 variables in my dataset. My question is: if for an observation/record, let's say I have 4 missing values, so can I use the remaining 6 for calculating the score and input that as a feature in my model. Would this be redundant?
 A: If you try the following
tmp <- runif(1000) # generate random vales
tmp[sample(1:1000, size = 100, replace = FALSE)] <- NA # generate some NAs

X <- matrix(tmp, ncol = 10) # make tmp a 100 x 10 matrix 

score <- apply(X, 1, function(x) sum(!is.na(x))) # get the score (number of complete covariates)

y <- sample(c(0, 1), size = 100, replace = TRUE) # generate binary y

mod <- glm(y ~ X + score, family = binomial(link = "logit")) # estimate a logistic regression

round(coef(mod), digits = 2) # gives

#(Intercept)     X1     X2    X3     X4     X5     X6     X7     X8     X9     X10  score 
#       2.74  -1.92  -1.36  0.24   0.45  -1.22   0.75  -3.84  -0.10   0.03    0.62     NA

If you think about it is clear that the coefficient of score has to be NA: in the regression only complete observations are used; and this means that only observations with a score of 10. So score is a constant varible in the regression model without any explanation. This changes of course if you can drop (non relevant) variables (eg):
glm(y ~ X[, c(1, 4:6, 9)] + score, family = binomial(link = "logit"))

