2
$\begingroup$

I am running a model (logistic regression) with 20 independent variables in R.

Before running the model I calculated the correlation between all the variables and finally selected my variables by also checking "visually" the histograms of each variable in the case of presence and again in the case of absence. In situations where I don't see any obvious distribution associated to both presence & absence, I discard the variable.

I would like to make "official" calculations for the level of relation between Presence/Absence and each variable (how much each variable contributes to the Presence/Absence), for example with Cramer's V index, but the available function I find is from the package vcd and has some limitations: doesn't give the Cramer's V (as well as the Phi-Coefficient Contingency Coeff.) for each independent variable, and it doesn't run for one independent variable.

I might be missing some other obvious way to do this. Any help is appreciated.

$\endgroup$
3
  • $\begingroup$ Is it possible to provide any of your code so we can see exactly what you are doing? $\endgroup$
    – user25658
    Aug 12, 2013 at 19:16
  • $\begingroup$ I think it's always worth wondering exactly why there was not "enough attention" first time round, including what was unclear. In this case it's not at all clear what Cramér's nu and phi are going to add to what is readily available from the logistic regression fit. You also seem to be imagining that the performance of the model can be divided into parts associated with each independent variable, but the model is best understood as a result of a team effort: the "independent variables" are most unlikely to be independent of each other. $\endgroup$
    – Nick Cox
    Aug 12, 2013 at 20:45
  • 1
    $\begingroup$ Why are you discarding variables? (stats.stackexchange.com/questions/18214/…) Why do you want to know the level of relation between the response and each predictor? $\endgroup$
    – momeara
    Aug 13, 2013 at 23:04

2 Answers 2

2
+50
$\begingroup$

Since your outcome appears to be dichotomous in nature (absence or presence) and you have numerous predictors of interest, why not calculate unadjusted odds ratios by performing simple logistic regression between each of your potential predictor variables of interest with the outcome (1 = absence; 0 = presence, or vice versa). If your sample size permits (wide confidence intervals may deter you from doing this based on your sample size if it is too small), you could put all of the potential predictor variables of interest into a multivariable logistic regression and assess adjusted odds ratios for each of your predictors in relation to your outcome after controlling for all of the other predictor variables included in your model. I hope this helps!

$\endgroup$
1
  • 1
    $\begingroup$ This seems like a much better way to go than using visual histograms of the predictors conditional on the outcome. If you want to make it official, do this and then use the p-value of the predictor from each individual logistic model as your metric. $\endgroup$
    – Mike Nute
    Aug 19, 2013 at 17:51
0
$\begingroup$

The problem appears odd. Regarding to the "Presence/Absence and each variable", if that variable is simply dropped (or added), other variables may take the responsibility (or lose) to fit the effect of that variable. This may change the model's meaning.

If this result/effect is not what you want, the "importance of variable" calculated by randomizing that variable column is a good way to do, to avoid the other variable takes the significance.

If this result/effect is exactly what you want to have, simply dropping and adding the variable to your full model is the way. But usually, fitting a model and then performing a forward or backward selection is the official way as variable selection.

$\endgroup$

Your Answer

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

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