cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
Big
Big
Level I

What is the best way to analyze the relationship between a binary and quantitative variable?

Hi, sorry if this is a really newb question but I'm working on a dataset for class on the relationship between depression and sleep. I have two variables, depression with a yes/no response, and average hours of sleep for each respondent (5,6,7,etc.). I analyzed the two for ANOVA and found their R-squared and the P value for the relationship, but is there a better test for this specific situation? I just want to establish if there is a link between the two variables and the significance or impact of depression on average hours of sleep.

 

Thank you for your help

2 REPLIES 2
dale_lehman
Level VII

Re: What is the best way to analyze the relationship between a binary and quantitative variable?

First of all, I'd suggest looking at the data - see if it look like there is a relationship (you can use Graph Builder), before doing any tests.  If hours of sleep are all integers and don't have too many levels, I'd make it nominal (or ordinal) and use Fit Y (depression) by X (hours of sleep) and the contingency table and Chi squared test would apply.  If hours of sleep is not all integers or has many levels (unlikely), then you could make it continuous and try fitting a logistic regression model.  You also don't indicate how much data you have - it might impact which analysis is more likely to yield something meaningful.  But I think it is always best to start by looking at the data.

Re: What is the best way to analyze the relationship between a binary and quantitative variable?

When you say 'relationship,' are you referring to correlation or something like it? Correlation measures the strength of a relationship between two continuous variables, and both are considered responses. ANOVA assumes that sleep is the dependent variable and depression is the independent variable. Is that they way you see it? If it is, instead, the other way around, the logistic regression, as recommended by @dale_lehman, is the most direct way to quantify and test the relationship. The Chi square statistic is used to evaluate the significance of the relationship, not the strength. The odds ratio indicates the strength for you.