From 3d642e39ef9da693d06b998b081704c07b6af945 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Mon, 17 Sep 2018 09:29:21 -0600 Subject: [PATCH] Set up iteration for fixed-effect matrix --- MATLAB/beefblup.m | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/MATLAB/beefblup.m b/MATLAB/beefblup.m index 896cb07..08ff208 100644 --- a/MATLAB/beefblup.m +++ b/MATLAB/beefblup.m @@ -90,4 +90,18 @@ end disp(' ') disp('If no animal matching this description exists, the results may appear') disp('outlandish, but are still as correct as the accuracy suggests') -disp(' ') \ No newline at end of file +disp(' ') + +% Form the fixed effect matrix +X = zeros(numanimals, sum(numgroups)-length(numgroups)+1); +X(:,1) = ones(1, numanimals); + +% Iterate through each group +for i = 1:length(normal) + % Find the traits that are present in this trait + traits = uniquecell(data(:,i+5)); + + % Remove the "normal" version from the analysis + normalindex = find(strcmp(traits, normal{i})); + traits(normalindex) = []; +end \ No newline at end of file