Hello @s75moham, welcome in this group.
I have no experience at all with 'linear mixed effect models' but being interested I tried to reproduce your problem. However I run into errors such as object 'Subject' not found
, but maybe I am not using the same packages as you. Therefore I enclose a REPRoducible EXample (reprex) of what I did.
A reprex consists of the minimal code and data needed to recreate the issue/question one is having. See e.g. whats-a-reproducible-example-reprex-and-how-do-i-do-one:
library(tibble)
library(nlme)
my_data = tribble(
~Subject, ~Group, ~Value1, ~Value2, ~Outcome,
1, "A", 12.404, 5.00, 1.33,
2, "A", 14.898, 4.34, 6.77,
3, "A", 13.870, 2.53, 5.01,
4, "A", 14.313, 9.33, 6.82,
5, "B", 13.407, 4.99, 8.42,
6, "B", 13.480, 2.59, 9.11,
7, "B", 13.761, 1.42, 8.21,
8, "B", 12.607, 0.55, 8.32
)
lme(Outcome~Value1+Value2+Group, random=1|Subject, data=my_data)
#> Error in reStruct(random, REML = REML, data = NULL): object 'Subject' not found
Created on 2020-09-03 by the reprex package (v0.3.0)
I would be helpful if you present your problem in the same way.
By the way 'googling' on linear mixed-effects models using r
also produced some results, but probably you are already familiar with these.