title: Need help writing estimates statements in proc genmod
body: <p>I'm using proc genmod to predict an outcome measured at 4 time points. The outcome is a total score on a mood inventory, which can range from 0 to 82.  A lot of participants have a score of 0, so the negative binomial distribution in proc genmod seemed like a good fit for the data. </p>
  
  <p>Now, I'm struggling with how to write/interpret the estimates statements. The primary predictors are TBI status at baseline (0=no/1=yes), and visit (0=baseline, 1=second visit, 2=third visit, 4=fourth visit), and an interaction of TBI status and visit. </p>
  
  <p>How do I write my estimates, such that I'm getting out:
  1. the average difference in mood inventory score for person with TBI versus a person without, at baseline. 
  and 
  2. the average difference in mood inventory <em>change</em> score for a person with TBI versus a person without, over the 4 study visits? </p>
  
  <p>Below is what I have thus far, but I'm not sure how to interpret the output, also below, if indeed my code is correct.: </p>
  
  <pre><code>proc genmod data = analyze_long_3 ;
    class id screen_tbi (param = ref ref = first) ;
    model nsi_total = visit_cent screen_tbi screen_tbi*visit_cent /dist=negbin ;
    output predicted = predstats; 
    repeated  subject=id  /type=cs; 
    estimate "tbi" intercept 1 visit_cent 0 0 0 0 screen_tbi 1 0 /exp;
    estimate "no tbi" intercept 1 visit_cent 0 0 0 0  screen_tbi 0 1 /exp; 
   estimate 'longitudinal   TBI'  intercept 1
                                  visit_cent -1 1 1 1 
                                  screen_tbi 1  0 
                                  screen_tbi*visit_cent 1 0 0 0 
                                                        0 1 0 0
                                                        0 0 1 0 
                                                        0 0 0 1
                                                        0 0 0 0
                                                        0 0 0 0
                                                        0 0 0 0       
                                                        0 0 0 0 / exp; 
  estimate 'longitudinal no  TBI '  intercept 1
                                  visit_cent -1 1 1 1 
                                  screen_tbi 0  1 
                                  screen_tbi*visit_cent 0 0 0 0
                                                        0 0 0 0
                                                        0 0 0 0       
                                                        0 0 0 0
                                                        1 0 0 0 
                                                        0 1 0 0
                                                        0 0 1 0 
                                                        0 0 0 1  / exp;  
  
    where sample = 1 ; 
  run;
  </code></pre>