I have a data with 24 variables(columns) and 1000 rows. Columns represent AGE,SALARY,REGION,GENDER, etc.
I need to find correlation between each column, (AGE,SALARY), (AGE, REGION) (AGE,GENDER) etc.i.e. I need to gdet 23*24=552 correlations. Is there any way to make a cycle or something, and get all those correlations at once, rather than find it seperately 552 times?
Please help! I can't do it 552 times. There must be a way!
UPDATE: I think I got what I wanted by
AGE SALARY REGION
AGE 1 NA 0.25
SALARY NA 1
REGION 0.25 NA 1
I think you want a correlation matrix, try this:
I think I misunderstood, if you want to correlate Age with every other column try this:
apply(yourdataframe, 2, cor, x = AGE)