Calculate Mean Score of subjects
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi,
I need help with reading .txt files and calculate the mean score for subjects. There are four tests, we only want the average of test 1, test 3, and test 4 accross all four subject (1_1, 2_2, 3_3, 4_4). If the subject is absent for that specific test, we marked as '1', for example subject 1_1 is absent for 'test 4' 30 days ago.
If the subject is absent for 'test n' 30 days ago and 30 days after, we will not calculate the average score for this subject. However, if the subject is absent for 'test n' 30 days ago but present 30 days after, we will still calculate the average score for this subject.
Only 4 subject in this data set only, but we are expanding the numbers of data (expecting to be 1000 subjects)
0 Commenti
Risposta accettata
Seth Furman
il 10 Nov 2021
You can
1) find the mean across several variables using mean(t{:, ["Var1", "Var2", "Var3"]}, 2)
2) find rows that meet a certain condition (e.g. absent for both tests) by using logical indexing such as t{t.Condition1 & t.Condition2, "Mean"} = missing.
t = array2table(randi(10, 3, 4))
t.Mean = mean(t{:, ["Var1", "Var2", "Var3"]}, 2)
t{t.Var1 > 5 & t.Var2 > 5, "Mean"} = missing
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Hypothesis Tests in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!