What test do I use to determine if there is a correlation between a discrete variable and a continuous variable? For example - I have water quality ratings for streams (excellent, good, fair, poor) and a corresponding nitrogen concentration for each rating. I want to know if the the ratings correlate with the concentration of nitrogen in the stream. Help?
This may be incorrect, but couldn't you just assign a number to the ratings 1:4 and then scatterplot them agianst N (x-axis). Or you may want to plot boxplots of N by water quality ratings. If these are water quality ratings derived from aquatic macroinvertebrates and you have access to the actual count information (reguardless of taxanomic level) you may want to consider some ordination techniques to see if there is an ecological gradient underlying your taxa information. hope this helps and good luck Stephen On Thu, Oct 16, 2008 at 9:05 AM, kdebusk <kdebusk at gmail.com> wrote:> What test do I use to determine if there is a correlation between a > discrete variable and a continuous variable? > > For example - I have water quality ratings for streams (excellent, > good, fair, poor) and a corresponding nitrogen concentration for each > rating. I want to know if the the ratings correlate with the > concentration of nitrogen in the stream. > > Help? > > ______________________________________________ > R-help at r-project.org mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Stephen Sefick Research Scientist Southeastern Natural Sciences Academy Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods. We are mammals, and have not exhausted the annoying little problems of being mammals. -K. Mullis
On Thu, Oct 16, 2008 at 8:05 AM, kdebusk <kdebusk at gmail.com> wrote:> What test do I use to determine if there is a correlation between a > discrete variable and a continuous variable? > > For example - I have water quality ratings for streams (excellent, > good, fair, poor) and a corresponding nitrogen concentration for each > rating. I want to know if the the ratings correlate with the > concentration of nitrogen in the stream.What does correlation mean in this example? How can you interpret a linear correlation when one of your variables is discrete? Why not start with some exploratory graphics? For your case, I would suggest drawing a histogram of nitrogen concentration for each water quality. Then look at the histograms - do they look the same? Do they look different? If they are different, what features are different? Hadley -- had.co.nz
kdebusk wrote:> What test do I use to determine if there is a correlation between a > discrete variable and a continuous variable? > > For example - I have water quality ratings for streams (excellent, > good, fair, poor) and a corresponding nitrogen concentration for each > rating. I want to know if the the ratings correlate with the > concentration of nitrogen in the stream.Here you have an ordinal and a continuous variable. The appropriate correlation method is polyserial (see polycor package) if you can assume that your categories arise from a normal distribution. Jim