1
$\begingroup$

I am doing logistic regression in r and want to give the best features to the model from a list of 200 variables and 25,000 records. A continuous variable(scc) is having 90 % 0’s. Following is the summary.

Min 0

1st Qu: 0

Median: 0

3rd Qu: 0

Max: 130

The rest 10% which are non-zero ranging from 1 to 130 and have close to 2500 records. Is these variable useful in predicting dependent variable as most of the values are 0 and if not how to test that before passing it to model.

what I did is used conditional box plot to compare the distribution conditioned on whether the dependent variable is 1 or 0 but the boxplot for both looks same.

library(fields)

bplot.xy(data $ dependent,data $ scc)

Please suggest

$\endgroup$
4
$\begingroup$

This is a form of cheating. This has been discussed extensively on this site. Variable selection that is utilizing relationships with $Y$ will result in serious overfitting and badly biased standard errors. Solutions include data reduction masked to $Y$ and penalization (shrinkage). My RMS course notes go into this in detail - see http://www.fharrell.com/p/blog-page.html .

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.