I have a table with many missing values. There are many columns with only missing values. The other columns have 1 non-missing value each, but it situates in different rows. I want to shift this value up to the first row. For the column with only missing variables, I do not change anything. I have not figured out how to do. I tried some idea such as creating an indicator of row that the value is not missing within each colum of variable, then set the values of all variables in the first column to be equal to the values of variables indicated by the number of row before, and then get rid of all the following rows to keep only 1 row. But I do not think this way will work.
I hope the pic below is clear enough to illustrate my case.
Many thanks.
I hope the pic below is clear enough to illustrate my case.
Many thanks.
Comment