anovan or fitlme for experiment with complex combination of factors
1 次查看(过去 30 天)
显示 更早的评论
The details of my experiment are as follows: Rats are split into four treatment groups. EEG data is recorded simultaneously at 23 regularly spaced depths within the rat brain for 50 minutes. The recording data is processed via fourier transform to provide 10 spectra representing 10 consecutive 5 minute periods. Power at a particular frequency range is extracted from each spectrum. Each datapoint is the average power over a 5 minute period (timepoint) at a given depth. What we are trying to learn are the effects on the DV (power at a specific frequency) of treatment over time and depth.
There are therefore three IVs: treatment group, timepoint, and depth. Timepoint and depth are both repeated measures because data at multiple timepoints and depths are sampled from the same animals.
I am unsure of how to approach this analysis. I have tried anovan with nesting but I don't know if it this is the correct approach.
Approach 1: treating depth and time as random variables and nesting depth within time
nesting = [0 0 0;0 0 0;0 1 0];
[p,~,stats] = anovan(datapower,{factorgroup factortime factordepth},'model','interaction','nested',nesting,'random',[2 3],'varnames',{'group','time','depth'});
Approach 2: treating depth and time as random variables, as well as creating a separate "animal" factor, and nesting that factor within the group factor
nesting = [0 0 0 0;1 0 0 0;0 0 0 0;0 0 0 0];
[p,~,stats] = anovan(datapower,{factorgroup factoranimal factortime factordepth},'model','interaction','nested',nesting,'random',[3 4],'varnames',{'group','animal','time','depth'});
Do either of these approaches get close to correctly gauging the primary and interaction effects? Should I try fitlme instead? In which case I am not at all certain how to construct the formula representing the model I want. fitlme seems to be built under the assumption that I am going to run a regression, which is not exactly what I want to do. I'm mainly confused about what an "intercept effect" is.
Would any of the following be an appropriate representation of my experimental setup?
'Power ~ Group + (Time|Animal) + (Depth|Animal)'
'Power ~ Group + Time + (Time|Animal) + Depth + (Depth|Animal)'
'Power ~ Group + (Time-1|Animal) + (Depth-1|Animal)'
'Power ~ Group + Time + (Time-1|Animal) + Depth + (Depth-1|Animal)'
I'm not sure how to proceed, and any help is appreciated!
0 个评论
回答(2 个)
Ben
2016-7-22
i feel your pain... i do similar experiments, and the biostats people here suggested mixed effects models (fitlme), although that could've been primarily due to the "unbalanced" nature of various levels in various groups of the hierarchy...
recently they told me that (due to not so many observations while trying to estimate too many terms) i should allow ONLY the intercept to vary randomly (by animal, i.e. each animal gets its own intercept, regardless of genotype or other effects taken into account already, because each animal may have a different "baseline", i.e. the intercept represents the response at zero treatment and?or zero depth and?or zero time...). this was after i "reduced" depth to a categorical variable (dorsal or ventral) so that i wouldn't have to worry about random effects of which depth i was sampling from. i imagine you could do the same with at least your depths...
there's a great youtube video on hierarchical linear models you could search called "HLM II: The General Linear Model and the Linear Mixed Model" from "methods consultants of ann arbor" that goes over how ANOVA and regression are mathematically identical somehow i didn't fully comprehend but it's certainly been useful for understanding mixed models.
the split plot experiment (tomato, soil, etc.) in the fitlme documentation (NOT fitlmematrix, although that may be useful for other reasons to you) might be appropriate for what you're looking for in terms of specifying random effects.
i know it's not much, but fwiw
Lima Parhiz
2020-1-15
Hello Andrew
I know this question is from a while ago but did you find out how to do the analysis? I have a somewhat similar data as you and I have to perform a similar analysis and have some issues with to proceed.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Analysis of Variance and Covariance 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!