I have data of disability (4 types of disability A, B, C and D) and I want to calculate the contribution of each type, so I need to remove one type each time, for example for calculating the contribution of type A I have to remove type A and calculate the disability free life expectancy(DFLE) without it then I do DFLE-DFLE(without A) to calculate its contribution. Now the problem is sometimes there is a comorbidity (individual has 2 types of disability at the same time) for example he has type A and B so how I can remove the A without removing the entire row
exmple of my data:
Ind | A | B | C | D |
i1 | 1 | 0 | 0 | 0 |
i2 | 1 | 0 | 1 | 0 |
i3 | 0 | 0 | 1 | 0 |
i4 | 0 | 0 | 0 | 1 |
i5 | 1 | 1 | 0 | 0 |
i6 | 0 | 0 | 1 | 0 |
i7 | 0 | 1 | 0 | 0 |
i8 | 1 | 0 | 0 | 1 |
i9 | 0 | 1 | 0 | 0 |
i10 | 0 | 0 | 1 | 0 |
I tried data<-disab[-which(disab$A)==”A”,] but when comorbidity existes it remove the entire row and that gives me wrong results, any suggestions ?
Nour is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.