Borrar filtros
Borrar filtros

function to measure the correlation between nominal and continuous data

6 visualizaciones (últimos 30 días)
cgo
cgo el 22 de Abr. de 2020
Respondida: BhaTTa el 17 de Jul. de 2024 a las 3:34
I am looking for a function that measures the correlation (Cramer's V, or something similar) of categorical + continuous data sets. I can't seem to find one. Can someone point me to the right direction.

Respuestas (1)

BhaTTa
BhaTTa el 17 de Jul. de 2024 a las 3:34
In MATLAB, you can use different statistical methods to measure the correlation between categorical and continuous data sets. While MATLAB does not have a built-in function for Cramér's V, you can use ANOVA (Analysis of Variance) to assess the relationship between a categorical variable and a continuous variable. You can also use point-biserial correlation if your categorical variable is binary.
Example: Using ANOVA in MATLAB
ANOVA can help determine if there are statistically significant differences between the means of different categories of a categorical variable.
% Example data
continuous = [1.2, 2.3, 3.1, 4.5, 5.0, 6.7, 7.8, 8.2, 9.1, 10.5];
categorical = [1, 2, 1, 2, 1, 2, 1, 2, 1, 2]; % Binary categorical variable
% Perform ANOVA
[p, tbl, stats] = anova1(continuous, categorical);
% Display the results
disp('ANOVA Table:');
disp(tbl);
% Display the p-value
disp(['p-value: ', num2str(p)]);

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by