I am trying to figure out how to analyze mixed-effect model («lme4» package, lmer function in R). Due to lack of experience, I have some questions that I would be grateful for help with. Currently I am analyzing the dynamic of substance concentration in different patients during the 6 days. As my sample has many missed values, and data are paired, it seems that mixed-effect model is the only suitable analysis here. Questions:
Can I perform the analysis considering the fact that the number of observations varies significantly at different time points?Since the assumption of residuals normality is not met, I had to perform the Box-Cox transformation and analyzed the transformed data. After that qq plot looks much better. However, I still see a slight heterogeneity in the variance of the residuals (plot(mod_2)). Should I be concerned about that?It is important for me to get first the omnibus test result for the main effect (day), not the significance of difference of each factor level vs reference category. Therefore, I first enter this predictor as an "integer". I suppose that this is not entirely correct. How can I assess the significance of a fixed effect?Before doing pairwise comparisons, I change the variable type “day” and “patient” into “factor” variable, otherwise I cannot get the results of pairwise comparisons. Is this okay?I would really appreciate any help.
library(lme4) library(lmerTest) library(ggplot2) library(MASS) library(multcomp) R4