Dear Statalist,

I want to do a Cox regression taking repeated measurements into account. I want to fit a model looking at survival in a group of patients having a certain chronic disease. Levels of anxiety are measured at two timepoints spaced 10 years apart, and I want to see whether change in the level of anxiety influences survival.

My data are in long format:

Code:
     +-----------------------------------------------+
     | id     PartDat   HADSAnxi   death     enddate |
     |-----------------------------------------------|
101. | 51   24 May 96          0       1   15feb2008 |
103. | 52   13 Jun 97          0       0   15jan2019 |
105. | 53   29 Sep 95          0       0   15jan2019 |
106. | 53   04 Jun 07          0       0   15jan2019 |
107. | 54   08 Oct 96          0       0   15jan2019 |
     |-----------------------------------------------|
109. | 55   17 Jan 96          0       0   15jan2019 |
110. | 55   17 Aug 07          0       0   15jan2019 |
111. | 56   28 Nov 95          0       0   15jan2019 |
113. | 57   18 Dec 95          0       0   15jan2019 |
115. | 58   24 May 96          0       1   15feb2007 |
     |-----------------------------------------------|
119. | 60   23 Oct 95          0       0   15jan2019 |
120. | 60   08 Oct 07          0       0   15jan2019 |
122. | 61   24 Jun 08          0       .   15jun2018 |
123. | 62   14 Feb 96          0       0   15jan2019 |
125. | 63   08 Nov 96          0       0   15jan2019 |
     |-----------------------------------------------|
126. | 63   31 May 07          0       0   15jan2019 |
127. | 64   17 Jun 96          0       1   15mar2016 |
129. | 65   06 Dec 95          0       0   15jan2019 |
131. | 66   27 Feb 96          1       1   15mar1999 |
133. | 67   18 Mar 97          0       0   15jan2019 |
     |-----------------------------------------------|
134. | 67   08 Apr 08          0       0   15jan2019 |
135. | 68   22 Nov 96          0       0   15jan2019 |
136. | 68   04 Feb 08          0       0   15jan2019 |
138. | 69   21 Nov 07          0       0   15jan2019 |
140. | 70   11 Jun 07          1       0   15jan2019 |
     |-----------------------------------------------|
145. | 73   20 May 96          0       0   15jan2019 |
146. | 73   27 Feb 08          1       0   15jan2019 |
147. | 74   16 Dec 96          0       0   15jan2019 |
150. | 75   28 Aug 07          1       0   15jan2019 |
151. | 76   04 Mar 96          0       1   15nov2015 |
     |-----------------------------------------------|
153. | 77   13 Dec 95          0       0   15jan2019 |
154. | 77   08 Feb 07          0       0   15jan2019 |
157. | 79   10 Jun 96          0       0   15jan2019 |
158. | 79   27 Apr 07          0       0   15jan2019 |
159. | 80   13 Mar 96          0       0   15jan2019 |
     |-----------------------------------------------|
160. | 80   08 Oct 07          0       0   15jan2019 |
161. | 81   26 Mar 96          1       0   15jan2019 |
162. | 81   22 Nov 07          1       0   15jan2019 |
163. | 82   12 Sep 95          0       0   15jan2019 |
164. | 82   29 Aug 07          1       0   15jan2019 |
     |-----------------------------------------------|
165. | 83   20 Feb 97          0       0   15jan2019 |
168. | 84   08 May 08          0       0   15jan2019 |
169. | 85   16 Apr 96          1       0   15jan2019 |
174. | 87   29 May 07          0       0   15jan2019 |
176. | 88   10 Apr 08          0       0   15jan2019 |
     |-----------------------------------------------|
177. | 89   04 Mar 96          0       1   15aug2013 |
179. | 90   20 Jan 97          0       1   15apr2003 |
181. | 91   14 Aug 96          1       1   15sep2015 |
184. | 92   04 May 07          0       1   15jan2014 |
185. | 93   27 Mar 96          0       0   15jan2019 |
     |-----------------------------------------------|
186. | 93   08 Jan 07          0       0   15jan2019 |
189. | 95   02 Oct 96          0       0   15jan2019 |
190. | 95   15 Nov 06          0       0   15jan2019 |
197. | 99   04 Mar 96          1       0   15jan2019 |
198. | 99   26 Nov 07          0       0   15jan2019 |
     +-----------------------------------------------+
Where PartDat is the dates of the two repeated measurements, HADSAnxi is a binary variable where 0 = no anxiety and 1 = anxiety, death is a binary variable where 1 = failure and enddate is the time variable.

I used the user-written jm suite downloaded from http://www.stata.com/jmxtst, and created the syntax as described by Yulia Marchenko here: http://www.stata.com/meeting/nordic-..._marchenko.pdf.

I use the syntax suggested for combined datasets (longitudinal and survival):

Code:
jmxtstset idvar timevar, xt(is xt)|st(is st) failure(failvar) stsetopts

where is xt and is st should be binary variables identifying longitudinal and survival observations, respectively (according to the slides above).
However, I get the following error code when trying to jmxtstset the data:

Code:
. jmxtstset id enddate, xt(HADSAnxi)|st(death) failure(death==1)
variable death==1 not found
Questions:
1) Is it not possible to specify failure using a binary variable like you could do with -stset-?
2) How should I specify is xt and is st?
3) Are there any online manuals available for jm, even though it's a preliminary command suite?