Open zhq90 opened 1 year ago
If each subject has two or multiple samples (e.g., pre and post treatment), then these samples have a common SubjectID, and are not independent. So we need to treat SubjectID as a random effect and include it in the regression formula ( (1|SubjectID)). Here 1 in (1|SubjectID) means that we do not consider the interaction between SubjectID and some other variable.
If I want to corrected the effect of other variables (like gender, Age......) on the result, should I use "formula = '~Smoke+Gender + Age", or "formula = '~Smoke+(1|Gender) + (1|Age)"?
Use '~Smoke+Gender + Age" as Gender and Age are fixed effects not random effects.
In linda() function, what is (1|SubjectID) for? Is it the random variables to be corrected?