I have some data with predictor variables, A and B and response variable C. I have a grouping factor SITE.
df <- data.frame(A = c(0.4, 0.4, 0.2, 0.2, 0.2, 0.2, 0.2), B = c(0.3, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1),
C = c(4.4, 4.3, 5.6, 4.7, 5.1, 4.5, 4.9), SITE = c("south","south","east","east", "east", "north", "north"))
The relationships between C and predictor variables are non-linear.
I have not shown all the dataframe.
I would like to fit a non-linear mixed effects model with random effects in R.
I can use the nlme() package to fit this model. However, I am struggling to find any 'accessible' (I don't have a strong statistics background) documentation that goes through how I can set up the model.
Could someone please assist me in sitting up my model?
My 'attempt' to set up the model is:
m1 <- nlme(C ~ A + B, data = df, random = ~1 | SITE)
However, when I run the above, I get an error: argument "start" is missing, with no default.
Kind Regards, Matt.