# How to run correlation test between each value of an ordinal variable based on a dependent continuous variable values?

Hi i have two data sets on which i need to run statistical test and correlation analysis.

column A has ordinal values ranging from 1 to 7. column B has nominal values A, B, and C. column C has continuous variable. and column D has the dependent (Y) continuous variable.

I need to run test to confirm correlation between column A values based on column D values alone and with column B as another identifier i.e. correlation in each area of A, B, and C of column B. another correlation test needs to be run between column C and column D one on one and with column B. i would also like to run all the other tests to confirm other relationships. i am using the JMP software to run tests.

i would really appreciate assistance on running the right test. i am not sure how to upload data but I would be happy to do so as well.

• Do you mean that you want to see if the col A values that have A in col B are correlated with the col D values, etc? – gung - Reinstate Monica Jan 5 '15 at 1:07

Consider using ordinary least squares, where as you've specified, column D is the outcome variable. This would be a basic equation you are modeling, with no interactions:

$D=\beta_1 A+\beta_2 B_B+\beta_3 B_C+\beta_4C$

The $\beta$s give you the relationship between each variable and D, independent of the other variables in the model. I'm treating A as continuous - it is ordinal, but with 7 levels - you can often treat that roughly as continuous. It is not always appropriate, but it could initially identify a relationship. You could alternatively include each level of A, like I've done with C but it get's a little messier. Also notice I've left out $B_A$ - that is for identification purposes and you cold just as well choose a different level to omit. $\beta_2$ and $\beta_3$ represent the average difference between $B_A$, and $B_B$ and $B_C$, respectively.

Now, if you have reason to believe that the relationship between A and D, or C and D depends on the level of B (which it sounds like you might), you can approach the modeling different ways. One way would be to include interaction effects between each of the levels of B and A and C, as such:

$D=\beta_1 A+\beta_2 B_B+\beta_3 B_C+\beta_4C+\beta_5 B_B*C+\beta_6 B_C*C$

In this case, the coefficients $\beta_5$ and $\beta_6$ represent the difference in the relationship of C depending on the level of B. This model, as well as the initial model, assume the relationships between D and A and C are linear. If you do not believe they are linear, you can include polynomial terms, though keep in mind that gets more complicated to interpret, particularly with interactions.

Another alternative would be to run initial model above on all three subgroups of B, and then compare the coefficients across the three models. I'm not familiar with JMP to know how this may be done, but in a program like R or Stata this can be done fairly easily. Keep in mind, these results hold for dependent variables that are continuous. If your dependent variable is not continuous, or you are looking at nonlinear models, then it gets much more complicated.