Programming the statistical procedures from SAS

proc GENMOD repeated

Reply
Occasional Contributor
Posts: 16

proc GENMOD repeated

when I use the following codes, it doesn't show the NB dispersion.
proc genmod data=crash ; class ID year;

model accident = major minor / dist=negbin link=log
type3 wald; Repeated Subject= ID;
but when I delete " type3 wald; Repeated Subject= ID" it shows dispersion. How can I have estimated dispersion in type 3 repeated procedure.
Thanks.
Regular Contributor
Posts: 169

Re: proc GENMOD repeated

That seems very odd. Have you submitted this to SAS tech support?

You could try the glimmix procedure for fitting a GEE using ML estimators instead of moment estimators of the working correlation structure. Glimmix code that fits the same model as your genmod code would be:

proc glimmix data=crash empirical=hc0;
  class ID year;
  model accident = major minor / dist=negbin link=log;
  random _residual_ / subject=ID;
run;


The glimmix procedure will produce type3 Wald tests by default, so you do not need to specify any additional options to obtain these statistics. The empirical=hc0 option requests traditional sandwich standard errors. Note that the glimmix procedure offers other methods for computing robust standard errors - improvements on the traditional sandwich estimates. You might want to use empirical=hc3. See the following manuscripts regarding sandwich estimates:

http://weber.ucsd.edu/~mbacci/white/pub_files/hwcv-019.pdf
http://www.jstor.org/stable/pdfplus/2685594.pdf

SAS documentation discussing use of the glimmix procedure for producing a GEE-type analysis can be found at:

http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_glimmix_sect...

HTH
Occasional Contributor
Posts: 16

Re: proc GENMOD repeated

I know it's odd. Here is my codes. I'm assuming when I define NB distribution it should give me overdispersion.




data crash;
input Intersection y major minor accident Wt;
datalines;


1 3 9.8 9.9 10 0
1 4 9.7 9.8 10 0
1 5 9.8 9.8 9 0
1 6 9.9 9.8 4 -1.10
2 2 10.7 9.5 38 0
2 3 10.7 9.5 46 0
2 4 10.7 9.6 44 0
2 5 10.7 39 -0.29
3 1 11.0 9.2 41 0
3 2 11.0 9.3 49 0
3 3 11.1 9.3 40 0
3 4 11.1 9.4 20 -1.10
4 2 10.4 10.0 40 0
4 3 10.4 10.1 31 0
4 4 10.2 9.9 45 0
4 5 10.3 10.1 38 -0.29
5 3 10.6 10.4 78 0
5 4 10.6 10.4 64 0
5 5 10.6 10.4 54 0
5 6 10.6 27 -1.39
6 2 10.4 10.1 57 0
6 3 10.4 10.1 51 0
6 4 10.2 10.1 49 0
6 5 10.3 10.2 14 -1.39
7 2 10.5 10.4 56 0
7 3 10.5 10.4 41 0
7 4 10.4 10.4 50 0
7 5 10.6 10.4 21 -0.54
8 2 10.3 9.6 41 0
8 3 10.3 9.7 31 0
8 4 10.4 9.7 33 0
8 5 10.4 9.9 9 -1.39
9 1 10.2 8.7 20 0
9 2 10.1 8.6 4 0
9 3 10.2 8.5 14 0
9 4 10.0 8.2 15 0
9 5 10.1 8.6 8 0
9 6 10.1 8.6 11 0
10 1 9.9 8.0 13 0
10 2 9.9 8.0 9 0
10 3 10.0 8.1 12 0
10 4 10.1 8.1 10 0
10 5 10.1 8.2 12 0
10 6 10.0 8.1 16 0
;
run;
proc genmod data=crash; class Intersection y;
model accident = major minor/ dist=nb link=log
offset= Wt type3 wald; Repeated Subject=Intersection;

run; quit;
Ask a Question
Discussion stats
  • 2 replies
  • 204 views
  • 0 likes
  • 2 in conversation