How to Employ Nested or Multi-Level Groups in Mixed Effect Models

6 views (last 30 days)
I'm analyzing kinematic data in preparation for a publication on animal flight. I need to run a mixed effect model analysis (either linear or nonlinear) on my data, which consists of several nested groups.
Specifically, it is not clear to me whether nlmefit or nlmefitsa accept multi-level inputs. I do not have experience with what Matlab calls "grouped data" (although I of course mostly understand arrays, structs, and cell arrays). Second, it is not clear to me how said grouped data should be arranged for input into nlmefit or nlmefitsa. nlmefit does not show up under the list of "functions for grouped data," and yet the Matlab nlmefit documentation says "nlmefit(X,y,group,V,fun,beta0)...group is a grouping variable...group is a categorical variable, a numeric vector, a character matrix with rows for group names, or a cell array of strings....see Grouped Data"
Thus an example and verification would be helpful. In my case, let's pretend there are 4 experimental butterflies, which each yielded several (1 to 3) videos of maneuvering data, at different points in time (several days) after they left their cocoons. Thus, moth identity, age in days after emerging from cocoons, and day of filming are all random experimental effects and constitute various groups. Each video consists of a time series of many flaps and compares the position of the wings at certain points in the stroke cycle to the observed maneuvers. In this imaginary example, fixed effects are things like wing angle at certain points of the stroke cycle versus acceleration.
While Matlab gives at least two examples of using nlmefit or nlmefitsa with non-nested groups, I am uncertain whether one can use (and if yes, how to use) nlmefit or nlmefitsa with nested groups like this.
For simplicity, here's an imaginary data set showing the random effects:
moth 1: 2 sets of data,
video 1 on filming day 12/22/2010, 4 days after eclosure
video 2 on filming day 12/23/2010, 5 days after eclosure
moth 2: 1 set of data,
video 1 on filming day 12/22/2010, 8 days after eclosure
moth 3: 3 sets of data,
video 1 on filming day 12/20/2010, 2 days after eclosure
video 2 on filming day 12/20/2010 (same day), 2 days after eclosure
video 4 on filming day 12/28/2010, 10 days after eclosure
moth 4: 2 sets of data,
video 1 on filming day 12/29/2010, 3 days after eclosure
video 2 on filming day 12/30/2010, 4 days after eclosure
  2 Comments
CVR
CVR on 4 Oct 2013
Anyone has any ideas about this?
I am looking for a solution to this problem too,,
Abbie
Abbie on 17 Jul 2015
Has anyone made any progress on this? I also need to be able to identify nested groups in the nlmefit function.

Sign in to comment.

Answers (0)

Categories

Find more on Thermal Analysis in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!