Closed luthientinuviel closed 2 years ago
P.S. my apologies, i did not realize that hashtags from my code would cause the formatting issue. Hopefully it is not too distracting.
Thanks for the report.
1) Can you show the result of sessionInfo()
, since this might have been fixed in a newer version. (Or at least produced a clearer error message)
2) Can you provide a minimal reproducable example where I can recreate the same error from a new R session
3) For fitExtractVarPartModel()
all categorical variables must be random effects. If you are doing hypothesis testing with dream()
they can be fixed or random.
Gabriel
Hi Gabriel, thanks for the prompt response. Sorry for not providing enough info. I looked into the code of the function and realized that one of study participants was missing the cytokine data, and after I removed that person, I was able to run the code and produce the plots.
Thanks for clarifying re: categorical variables.
One more quick question - when determining variance coming from the participant vis-a-vis total variance, I assume you can do this only if you have multiple samples from the same participant?
Thanks so much, LT
Yes, missing data will cause an error. I will look into making it clearer. Variance partitioning works by estimating variance within a level of a categorical variable. So you need at least 2 observations per category for this to work
Hi there,
I am trying to use Variance Partition to determine the variance contributed by different variables in my model. The outcome variables are cytokines, and independent variables age, sex, race, bmi and participant_id. I have two questions.
1) I am running into an error when I try to run the model. I believe I have prepped the data correctly - matrix is the matrix of cytokines (rows) by samples (columns), form is the lin mixed model formula, and info is the metadata (samples in rows, relevant metadata in columns). Here is the code, with the error message below:
Can you please tell me what I am doing wrong? I could not find any references to this error.
2) Do all independent categorical variables need to be modeled as random effects? In my other models, I modeled only participant_id as random effect, while sex and race were fixed.
Thanks so much for your advice! Much appreciated! LT