# Is mixed model a right method to apply?

I have a data set including four variables (ID,Time, group, result) in the following format. I want to see if the result (such as Calcium) change over time in different group or not. I was wondering what is the right statistical model to use? Can I use two way mixed anova for this analysis?

> Id     time   group     Result
1        0       0
1        1       0
1        2       0
2        0       1
2        1       1
2        2       1
3        0       0
3        1       0
3        2       0


Also, I am confused between choosing aov with Error(ID/Time) and lmer with (Time|ID)? Which one I need to choose?

In case you have a balanced design in which all subjects only have measurements on specific time points, and provided that you have a moderate number of subjects, the best you could do is to fit a marginal model with an unstructured covariance matrix, e.g., using function gls() from package nlme. In your case, something like
fm <- gls(Result ~ time * group, data = <your_data>, correlation = corSymm(form = ~ 1 | Id), weights = varIdent(form = ~ 1 | time))