Reshape/gather function to create dataset ready for multilevel analysis
问题 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