Correlation between %Diabetic and %Inactive

correlation is a statistical measure which indicates the extent to which two variables vary together. It quantifies the strength and direction of a linear relationship between two variables. The correlation coefficient is a numerical value that ranges from -1 to 1

Retrive dataframe using variable diainac_df :

To obtain correlation between %Diabetic and %Inactive perform : diainac_df[‘% DIABETIC’].corr(diainac_df[‘% INACTIVE’]),

The ‘corr’ method is a pandas function used to compute correlation coefficients. The resulting value is stored in the variable correlation coefficient

A correlation coefficient of 0.441706 indicates a moderate positive linear relationship between the two variables. As one variable increases, the other tends to increase, and vice versa.

 

Leave a Reply

Your email address will not be published. Required fields are marked *