I asked a question but it was a bit long and confusing so I will attempt to keep this shorter and simple (original post https://stats.stackexchange.com/questions/24971/mixed-effects-model-equations)
I am basically looking to see which factors (e.g. A, B, C such as habitat type, site, disturbance rate) most affect the response value (y). I am finally understanding the concept of models and how to compare AIC values to see which combination of factors best explain y (have greater effect on), but I am new to R so wonder if my basic coding is correct.
Firstly I have all my data in a spreadsheet saved as a .csv file, so I read this file into R. I also open the package lme4.
Then I was thinking of using the following code (although letters would be the headings fo each set of values)
m1<-lmer(y ~ A + (1|E), REML=FALSE)
m2<-lmer(y ~ B + (1|E), REML=FALSE)
m3<-lmer(y ~ A + B + (1|E), REML=FALSE)
m4<-lmer(y ~ A + C + (1|E), REML=FALSE)
m5<-lmer(y ~ B + C + (1|E), REML=FALSE)
m6<-lmer(y ~ A + B + C + (1|E), REML=FALSE)
m4<-lmer(y ~ A + D + (1|E), REML=FALSE)
m5<-lmer(y ~ B + D + (1|E), REML=FALSE)
m6<-lmer(y ~ A + B + D + (1|E), REML=FALSE)
m7<-lmer(y ~ C + (1|E), REML=FALSE)
m8<-lmer(y ~ D + (1|E), REML=FALSE)
My basic questions are:
Let us say that C and D are similar factors, and derived from the same data and I do not think it useful to see if they have additive effects, is it okay not to put them in the same model, i.e. mix and match as see fit, or should all combinations be incorporated?
I chose ML because not all sets of values are mixed and matched. Is this correct or should I use REML?
Some sets of values are non-continuous, e.g. brood number or habitat type (either 1 or 2). Should I be letting R know this. Someone mentioned coding each factor but I have no clue how to do this, or is the csv file enough and then perhaps code to let R know about these particular ones?
Lastly, is there also a way to see p-values to see if the factor has a significant effect rather than just being the best fit to explain y?
I hope that this is more simple than my first post and easier to answer all at once. I really wanted to run this model today, but don't want to have to redo it all finding that I made a simple mistake.