2
$\begingroup$

I am trying to predict whether client would take up a promotion or not using the random forest model. From the variable importance plot output, it is shown that the number of days pass the day of contact(which I bin in days of 5) is the most important variable in the predictive modelling.

However, when I put this into a hypothesis testing, chi square test, the p-value is greater than 0.05. How do I reconcile these two facts or if there is a better way of testing that the number of days in relation to whether client would take up a promotion?

$\endgroup$
3
  • $\begingroup$ how do you perform the chi^2 test? $\endgroup$
    – rep_ho
    Commented Apr 16, 2021 at 11:46
  • $\begingroup$ @rep_ho that would be chi^2 test on the categorical variables: ContactDay & Yes/No $\endgroup$
    – AGZH12
    Commented Apr 16, 2021 at 12:57
  • $\begingroup$ Might be the case that the effect is confounded by other variables. Generally though, the p value does not tell you how important a variable is or if its effect is large or not. $\endgroup$ Commented Apr 16, 2021 at 13:20

1 Answer 1

2
$\begingroup$

You lost information by binning, see Why should binning be avoided at all costs?. For an alternative, use logistic regression and spline the day of contact variable. For details see Logistic Regression with regression splines in R or Using splines to address non-linearity in logistic regression

$\endgroup$
2
  • $\begingroup$ thanks for the reply. I tried logistic regression before but the accuracy rate is not as good as the random forest model. I would just like to check if using any other hypothesis method would be good for testing $\endgroup$
    – AGZH12
    Commented Apr 16, 2021 at 14:23
  • $\begingroup$ Then please edit the post to give some more info, like other covariables, sample size, show us a plot, ... $\endgroup$ Commented Apr 16, 2021 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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