# How to compare columns from two data sets in a loop

3 visualizaciones (últimos 30 días)
Tomaszzz el 10 de Mzo. de 2022
Editada: Tomaszzz el 10 de Mzo. de 2022
Hi all,
I want to compare columns from two data sets in a loop using the ICC function. Is there a way to simplify what I am doing below?
%Import csv file with data
sq_dot1 = importfile('sq_dot1.csv');
sq_dot2 = importfile('sq_dot2.csv');
% variable 1
var1=[sq_dot1(:,1),sq_dot2(:,1)];
[var1_r, var1_LB, var1_UB, var1_F, var1_df1, var1_df2, var1_p]=ICC(var1,'C-k',0.05,0.5);
var1_SD= std(var1(:,1)) + std(var1(:,2))/2;
SEM_var1=var1_SD*sqrt(1-var1_r);
% variable 2
var1=[sq_dot1(:,2),sq_dot2(:,2)];
[var2_r, var2_LB, var2_UB, var2_F, var2_df1, var2_df2, var2_p]=ICC(var2,'C-k',0.05,0.5);
var2_SD= std(var2(:,1)) + std(var2(:,2))/2;
SEM_var2=var2_SD*sqrt(1-var2_r);
% repeat for remaining 52 variables
%save results as a table with rows as variables
row1 = var1
row2 = var 2
row3 = var 3 etc
% and column headers as outcomes
r, LB, UB, F, df1, df2, p, SEM
##### 2 comentariosMostrar NingunoOcultar Ninguno
KSSV el 10 de Mzo. de 2022
What is ICC? What it does?
Tomaszzz el 10 de Mzo. de 2022
Editada: Tomaszzz el 10 de Mzo. de 2022
@KSSVThanks. interclass corrleation coefficient; describes how strongly units in the same group resemble each other; so in this case how strongly q_dot1(:,1) resembles sq_dot2(:,1).

Iniciar sesión para comentar.

### Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

### Community Treasure Hunt

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

Start Hunting!

Translated by