I am having issues reshaping the sample data below. I want to have wgt to be in long format. Any help/advise will be appreciated.


Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input long id int(wgt_1 wgt_2 wgt_3 wgt_4 time) float(trt kill grav)
2049 35  .  .  . 10 0 3 35
2050 25 25 20 20 10 0 1 23
2051 25 25  . 40 10 1 1 30
2055  . 30  .  . 10 0 1  .
2060  . 40  .  . 10 0 3 40
2067  . 25  . 20  7 1 1 25
2071  . 30  . 20 10 1 1 25
2073 35 35  . 20  7 0 3 30
2075  . 50  . 30 10 0 3 40
2076 40 20  .  .  7 0 1 30
2077  .  . 35  .  6 1 1  .
2083  . 25 20 25  6 0 1 25
2083  . 30  . 25  7 0 1 27
2083  . 55  . 35  7 0 .  .
2083  . 40  . 25  7 0 3 32
2083 30 20 30 20 10 0 1 25
2101 20 20 20 20  6 1 0 20
2110  . 55 30  .  7 0 3 42
2110 35 40 30 25  8 0 3 35
2110  . 35  . 30  9 0 3 32
2113  .  .  . 30 10 0 1 30
2118  . 40  . 30 10 0 3 35
2119 40 45  . 25 10 1 3 37
2120 25 25 20 20  7 0 0 23
2120  . 20  . 15 10 0 1 18
2126 55  .  .  .  8 1 3 55
2130  . 30  .  .  7 1 1 30
2130  . 35  .  . 10 1 3 35
2135  . 60  .  .  8 0 .  .
2136 25 20 20 20  6 0 0 22
2136  . 45  .  .  9 0 .  .
2140 30 30 20 25 10 1 1 27
2142  . 30  . 30 10 0 1 30
2154  . 20  . 25  6 1 1 22
2154 25 20 20 25  7 1 1 22
2154  . 15 30 30 10 1 1 25
2155 25 20 20 30  8 1 1 20
2156  . 40  . 30 10 1 3 35
2158  . 40  . 30  7 0 3 35
2158 65 45 40 45  9 0 3 50
2164 30 30 30 25  8 0 1 30
2164 40 30 20 20 10 0 1 30
2169  . 40 35  .  6 1 3 38
2169 40 35 30 30  7 1 3 35
2169  . 30  . 30  9 1 1 30
2170 15 15  . 15  7 0 0 15
2170  . 15 15 15 10 0 0 15
2171 60  . 40 25  6 1 3 42
2171  . 35  . 30  7 1 1 32
2171 40 40  . 30  8 1 3 37
end
label values time time1
label def time1 6 "1 yr", modify
label def time1 7 "2 yr", modify
label def time1 8 "3 yr", modify
label def time1 9 "4 yr", modify
label def time1 10 "5 yr", modify
label values trt trtlb
label def trtlb 0 "active", modify
label def trtlb 1 "placebo", modify
I get an error that says "variable deb contains all missing values" when I try
Code:
reshape long wgt, i(id) j(deb)