Dear StataList,

I am using Stata 14 on a Mac OS Yosemite 10.10.5. I am trying to use gsem to weight data from an intensive sample (so just a subsample of the full sample) back to the original sample, as one approach I have read about it using auxiliary variables in a sem framework. These auxiliary variables were those used to select people into the intensive sample (here t1_SCQ_total t1_fs_rIQ - corresponding to autism symptom severity and IQ).

The analysis itself is looking at continuity in psychiatric diagnoses over time, so testing if you have a diagnosis at t1, will you be likely to have that diagnosis at t3 (10 years later), but it needs to be weighted back to the original sample. The code is below - I thought it was possible to specify the parameters of the people in the latent classes (here we are specifying the 4 possible combinations of ADHD diagnostic status at t1 and t3 - so +/+ (diagnosis at both time points) -/- (no diagnosis at either time point), +/- (diagnosis at t1 but not t3) and -/+ (diagnosis at t3 but not t1)) but I am getting a basic error about syntax. I have tried googling/looking on the forums but haven't quite found the answer - and I wondered if anyone could help me with this.

Code:
gsem (1: t1_p4_adhd <- _cons@-10 , fam(bin) link(logit))(1: t3_j5l_adhd_any <- _cons@-10, fam(bin) link(logit))  ///
     (2: t1_p4_adhd <- _cons@10  , fam(bin) link(logit)) (2: t3_j5l_adhd_any <- _cons@-10, fam(bin) link(logit)) ///
     (3: t1_p4_adhd <- _cons@-10 , fam(bin) link(logit))(3: t3_j5l_adhd_any <- _cons@10, fam(bin) link(logit))  ///
     (4: t1_p4_adhd <- _cons@10 , fam(bin) link(logit)) (4: t3_j5l_adhd_any <- _cons@10, fam(bin) link(logit)) ///
     (t1_SCQ_total t1_fs_rIQ   <-  ) (sex <- , fam(bin) link(logit)) (C <- ) , lclass(C 4) iter(50)          
estat lcprob
lincom _b[4.C:_cons]-(_b[2.C:_cons]+_b[3.C:_cons])
Many thanks,

Virginia