I have a dataframe containing the safety data for 100 patients. There are different safety factors for each patient with the size of that specific factor.
v1_d0_urt_redness v1_d0_urt_redness_size v1_d1_urt_redness v1_d1_urt_redness_size ...
P1 1 20
P2 1 NA
P3 0 NA
.
.
.
Here redness=1
means there was redness and redness=0
means there was no redness, and therefore the redness_size
was not reported.
In order to find what proportion of the data is missing I need to code the data as follows:
if (the column containing redness=1 & the column containing redness_size=NA) then (the column containing redness_size<-NA) else if (the column containing redness=0 then the column containing redness_size<-0)
to have this coded for d0,d1,.. and to repeat this process for the other variables like hardness, swelling and etc. Any ideas how one could implement this in R?