multilevel-analysis

Multiple random effects in a linear mixed model with nlme and lme4

可紊 提交于 2021-01-29 06:17:40
问题 I would like to study differences in fat between 2 visits with a linear mixed effects model. So everything would start as lme(fat~ , now... for the coefficients, I have some that will change from visit 1 to visit 2, as they are hypertension status, diabetis status, bmi, waist circunference, smoking_status etc. And other variables that won't change from visit 1 to visit 2, as they are gender or ethnicity. Note that the following variables are dummy ( hypertension status, diabetis status,

Reshape/gather function to create dataset ready for multilevel analysis

送分小仙女□ 提交于 2019-12-04 02:13:42
问题 I have a big dataset, with 240 cases representing 240 patients. They all have undergone neuropsychological tests and filled in questionnaires. Additionally, their significant others (hereafter: proxies) have also filled in questionnaires. Since 'patient' and 'proxy' are nested in 'couples', I want to conduct a multilevel analysis in R. For this, I need to reshape my dataset to run those kind of analysis. Simply said, I want to 'duplicate' my rows. For the double subject IDs add a new variable