I am planning a study and would like to perform a power analysis to design the optimal sampling strategy. I would like to know what effect sizes we would have the power to detect and for an effect size of X, how many samples would be necessary to detect a significant effect and which sampling strategy would be optimal.
The study is to assess whether there is a significant effect of habitat type on the growth rate of a species of snake. We will be collecting and measuring the length of snakes from three different habitats (riverine, woodland, grassland). We expect that a snakes age will be the strongest predictor of its length. We have a way to estimate snake age to include this information in the model.
Data collected will look something like this:
Sample length(cm) Age(years) Habitat
Snake1 30 3 Riverine
Snake2 43 5 Riverine
Snake3 10 1 Woodland
Snake4 15 2 grassland
So to model if we will have power to detect an effect of habitat on the growth rate I believe I want to do a generalized mixed effect model, as. I want to see the effect of a categorical variable (habitat) on growth rate. I am unsure about the correct way to model this as I am only measuring snake length but it is growth rate that I am actually trying to measurelearn, which is the slope of age and length.
I am not very familiar with generalized mixed models. From what I have been reading would it be appropriate to run two mixed models, one with and one without habitat as a predictor variable and then use an ANOVA to compare the two models to see if habitat has a significant effect on the response variable? I do not want the model to assume that growth rate is linear in each habitat, as the growth curve is something that may vary between habitats that we are also interested to measure. I'd like the model to make as few assumptions as possible. This This is how I have it formulated so far but as I do not yet fully understand the model I suspect this is not correct:
Model 1: Length ~ (1 + age | habitat) + age
Model 2: Length ~ (1 | habitat) + age
Then ANOVA(Model 1, Model 2)
I would greatly appreciate any assistance with formulating an appropriate model for answering thethis question I am interested in. Once I have a model I presume I can play around with generating simulated input data with different assumptions about the effect of habitat on growth rate and then change the sample sizes to see how many snakes I would need to measure to achieve a significant result.
At the moment we are planning to collect around 10 snakes in each habitat and a range of ages in each habitat. So itIt would be great to know if we assume a difference in growth rate of approximately 1cm per year how many snakes we would need to measure to detect this. I would also like to include error in the model later to account for misestimation of age and length (assuming we will have greater error in age estimates than length).
Answers that use R are welcome though I would be most interested in conceptually understanding how to formulate the correct model to address this question. Thank you in advance for your assistance.