Birgitle
2008-Aug-06 14:16 UTC
[R] Correlation dichotomous factor, continous (numerical) and ordered factor
Hello R-User! I appologise in advance if this should also go into statistics but I am presently puzzled. I have a data.frame (about 300 rows and about 80 variables) and my variables are dichotomous factors, continuous (numerical) and ordered factors. I would like to calculate the linear correlation between every pair of my variables, because I would like to perform a logistic regression (glm()) without the correlation between variables. I thought I could use for the continous (numerical) and ordered factor a spearman correlation that is using the ranks. But I thought also that I have to use a contingency table for the dichotomous factors. I read also that it is possible to use a point-biserial correlation to calculate the correlation between dichotomous and continuous variables. Now I am confused what I should use to calculate the correlation using all my variables and how I could do that in R. Is it possible with cor(), rcorr(), cormat() or other R-functions using one of the available correlation-coefficients. I would be very happy if somebody could enlighten my darkness. Many thanks in advance. B. ----- The art of living is more like wrestling than dancing. (Marcus Aurelius) -- View this message in context: http://www.nabble.com/Correlation-dichotomous-factor%2C-continous-%28numerical%29-and-ordered-factor-tp18852158p18852158.html Sent from the R help mailing list archive at Nabble.com.
Mark Difford
2008-Aug-06 14:27 UTC
[R] Correlation dichotomous factor, continous (numerical) and ordered factor
Hi Birgitle,>> ... my variables are dichotomous factors, continuous (numerical) and >> ordered factors. ... >> Now I am confused what I should use to calculate the correlation using >> all my variables >> and how I could do that in R.Professor Fox's package polycor will do this for you in a very nice way. Regards, Mark. Birgitle wrote:> > Hello R-User! > > I appologise in advance if this should also go into statistics but I am > presently puzzled. > I have a data.frame (about 300 rows and about 80 variables) and my > variables are dichotomous factors, continuous (numerical) and ordered > factors. > > I would like to calculate the linear correlation between every pair of my > variables, because I would like to perform a logistic regression (glm()) > without the correlation between variables. > > I thought I could use for the continous (numerical) and ordered factor a > spearman correlation that is using the ranks. > > But I thought also that I have to use a contingency table for the > dichotomous factors. > > I read also that it is possible to use a point-biserial correlation to > calculate the correlation between dichotomous and continuous variables. > > Now I am confused what I should use to calculate the correlation using all > my variables and how I could do that in R. > Is it possible with cor(), rcorr(), cormat() or other R-functions using > one of the available correlation-coefficients. > > I would be very happy if somebody could enlighten my darkness. > > Many thanks in advance. > > B. > >-- View this message in context: http://www.nabble.com/Correlation-dichotomous-factor%2C-continous-%28numerical%29-and-ordered-factor-tp18852158p18852399.html Sent from the R help mailing list archive at Nabble.com.
Apparently Analagous Threads
- Point biserial correlation => Is there any specific command or could I just use cor.test?
- Simulate dichotomous correlation matrix
- Problem: No p-value for a point-baserial correlation with R
- GLMM: MEEM error due to dichotomous variables
- Dichotomous variables