MATLAB Answers

How to reshape data long version table in MATLAB into wide version table for more in deep repeated measures statistical analysis?

조회 수: 17(최근 30일)
Parishad Bromandnia
Parishad Bromandnia 2021년 9월 22일 14:18
답변: Steven Lord 2021년 9월 22일 14:50
Hi guys!
I have made a long version table (i.e., all data points for each participants) from the data of my eye tracking study. Attached you can see 8 first rows of all columns. Now to get into more in deep analysis I need to transform my table into a wide version. I would be grateful if you could let me know how I can reshape table and transform it into wide version.
Best regards,
Parishad
8×18 table
Part_ID Trials Exp_Block Gender Age Direction_L_R Speeds RTs Responses_T_F Target_Pos Target_L_R Tar_NoTar_Cond Sum_Fix_R Sum_Fix_L Prop mean_Fix_R mean_Fix_L First_Fix
_______ ______ _________ ______ ___ _____________ ______ ______ _____________ __________ __________ ________________ _________ _________ _______ __________ __________ _________
ul_1 1 1 M 24 Left 0 6.4794 No 0 No_Target TargetNotPresent 3125 8941 0.74101 0.20713 0.59263 1
ul_1 2 1 M 24 Left 15 8.9715 Yes 10 Left TargetPresent 7861 9768 0.55409 0.39323 0.48862 1
ul_1 3 1 M 24 Left 1 7.8579 No 0 No_Target TargetNotPresent 4358 10438 0.70546 0.24531 0.58756 1
ul_1 4 1 M 24 Left 5 9.7737 No 0 No_Target TargetNotPresent 6458 11996 0.65005 0.29913 0.55565 1
ul_1 5 1 M 24 Left 5 7.1119 Yes 6 Left TargetPresent 3685 7738 0.67741 0.22653 0.47569 1
ul_1 6 1 M 24 Left 15 8.7671 No 0 No_Target TargetNotPresent 6011 10023 0.62511 0.30682 0.51161 1
ul_1 7 1 M 24 Left 5 14.431 No 0 No_Target TargetNotPresent 10420 16106 0.60718 0.33727 0.52131 1
ul_1 8 1 M 24 Left 1 2.9246 Yes 8 Left TargetPresent 0 7329 1 0 0.92713 1

채택된 답변

Steven Lord
Steven Lord 2021년 9월 22일 14:50
It's not completely clear to me what you want your "wide version" of that table to look like, but I suspect the stack and/or unstack functions will do what you want.

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by