1. Post this on the R-sig-mixed-models list, not here. 2. (The following "advice" should be treated cautiously): Forget it! With only 5 bats, you have too little information to estimate variance components. Treat the bats as fixed effects and fit via lm (or glm if some of your responses are not gaussian).
As your statistical skills seem a mite weak, I would also suggest that you collaborate with your local statistician. As I would not submit my brain (diminished as it may be) to someone whose training comes largely from reading "Brain surgery for Dummies," neither would I trust the data analysis of someone whose statistical background is analogously informed. Apologies if I have misjudged. Cheers, Bert On Mon, Nov 14, 2011 at 5:44 AM, <hij...@gmx.net> wrote: > Dear all, > > I have the following dataset with results from an experiment with > individual bats that performed two tasks related to prey capture under > different conditions: > > X variables: > indiv - 5 individual bats used in the experiment; all of which performed > both tasks > task - 2 tasks that each individual bat had to perform > dist - 5 repeated measures of individual bats at 5 different distances > from the object > > all x variables I treat as categorical factors with levels > > Y - I have 8 dependent variables related to the structure of ultrasound > calls emitted by bats when performing each task. I know I can use them > together in the same model with the function cbind() but each variable > behaves a bit differently. Thus, I guess it would be better to build 8 > separate models. > > I believe "indiv" should be a random effect in the model; "dist" and > "task" should be fixed effects. > > I´d like to use the glmer (lme4) function to test two hypotheses: > > Main hypothesis: > There are differences in Y measurements between tasks, which are related > also to distance from the object. > > Secondary hypothesis: > Differences in Y measurements between tasks do not depend on the > individual. > > > I guess the simplest model for an AIC model selection would be: > print(Model.01<-glmer(y~task*dist+(1|indiv)) > - so any model that provides more details should have a lower (better) > AIC score. > Im not sure if Im coding the model correctly, so my hypothesis would be > properly tested. > > 1- Literature suggests to get rid of the pseudo-replication: my repeated > measures (dist) seem to behave like longitudinal data (as it is basically > a time series). This way, "indiv" would be nested in "dist". Furthermore, > "dist" levels have different variance, so it would be good to group the > data and somehow tell the model, that it should ignore differences in > variance. > (1|dist:indiv) or (dist|indiv)? > I am still wondering if the weights= argument would apply here? > > 2- dist is nested in task, as for both tasks I have the same distances > measured. > According to the description of the package lme4, I should write: > print(Model.02<-glmer(y~task*dist+(1|indiv)+(1|task:dist)) > > 3- according to the text -book The R book I understand that I should do > the following (as mentioned for the ratliver treatment-dataset): > rename factor levels to unique labels: > taskdist<-task:dist > taskdistindiv<-task:dist:indiv > print(Model.03<-glmer(y~task+(1|taskdist)+(1|taskdistindiv))) > > Or, pooling 1 and 3 together myself I would end up with: > print(Model.04<-glmer(y~dist*task+(1|indiv)+(1|task:dist)+(1|dist:indiv)) > > I doubt that all of them actually describe correctly what I want the model > to answer... > > I did not find any directly related comment in the R help. > > Thank you for your attention and for any help you may provide. > > -- > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.