Dear all,
I have a problem with transposing data from long to wide.
I'm doing a survival analysis with time-dependent variables.
I want to do multiple imputation of missing data, and for this I have to switch to wide data.
I have patients with different follow-up times and data are organized as follows:
Unfortunately when I use the "transpose" command I get a very strange error:
covariate2.066666603088379 invalid variable name
The strange fact is that the covariate has a "normal" name (a binary variable named "EventiYN")
Does anybody know how to fix this?
I have a problem with transposing data from long to wide.
I'm doing a survival analysis with time-dependent variables.
I want to do multiple imputation of missing data, and for this I have to switch to wide data.
I have patients with different follow-up times and data are organized as follows:
| id | covariate | covariate | time | event |
| 1 | 0 | 0 | 6 | 0 |
| 1 | 0 | 1 | 10 | 0 |
| 1 | 1 | 1 | 12 | 0 |
| 1 | 0 | 0 | 18 | 1 |
| 2 | 1 | 1 | 1 | 0 |
| 2 | 1 | 1 | 3 | 0 |
| 2 | 1 | 0 | 5 | 0 |
| 2 | 0 | 0 | 7 | 0 |
| 2 | 1 | 1 | 8 | 0 |
| 2 | 0 | 1 | 10 | 1 |
Unfortunately when I use the "transpose" command I get a very strange error:
covariate2.066666603088379 invalid variable name
The strange fact is that the covariate has a "normal" name (a binary variable named "EventiYN")
Does anybody know how to fix this?

Comment