1 / 38

10.4 Symmetry, Quasi-symmetry and Quasi-independence

10.4 Symmetry, Quasi-symmetry and Quasi-independence. SAS code:. data migrate; input then $ now $ count symm qi; datalines ; ne ne 11607 1 1 ne mw 100 2 5 ne s 366 3 5 ne w 124 4 5 mw ne 87 2 5 mw mw 13677 5 2 mw s 515 6 5

wei
Télécharger la présentation

10.4 Symmetry, Quasi-symmetry and Quasi-independence

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 10.4 Symmetry, Quasi-symmetry and Quasi-independence

  2. SAS code: data migrate; input then $ now $ count symm qi; datalines; ne ne 11607 1 1 ne mw 100 2 5 ne s 366 3 5 ne w 124 4 5 mw ne 87 2 5 mw mw 13677 5 2 mw s 515 6 5 mw w 302 7 5 s ne 172 3 5 s mw 225 6 5 s s 17819 8 3 s w 270 9 5 w ne 63 4 5 w mw 176 7 5 w s 286 9 5 w w 10192 10 4 ; symm - symmetry qi - quasi indep.

  3. SAS modeling procgenmod; class then now; model count =then now / dist=poi link=log; run;/*independence DF=(4-1)+(4-1)=6, residual DF=9 */ procgenmod; class symm; model count = symm / dist=poi link=log; * symmetry DF=4-1+4*(4-1)/2=9, residual DF=6 ; procgenmod; class then now qi; model count = then now qi / dist=poi link=log; * quasi indep DF=(4-1)+(4-1)+(5-1)=10, residual DF=5 ; procgenmod; class then now symm; model count = symm then now / dist=poi link=log; *quasi symmetry DF=(4-1+4*(4-1)/2)+(4-1)=12, residual DF=3 ;

  4. Symmetry model – predicted values • data

  5. Quasi Indep. model – predicted values • data

  6. Quasi Symmetry model • data

  7. Quasi symmetry

  8. 10.4.7 Premarital and extramarital sex example revisited symm qi - quasi indep.

  9. G2=402.2 DF=6 G2=1.36 DF=3 procgenmoddata=sex; class symm; model count = symm / dist=poi link=log; * symmetry; procgenmoddata=sex; class extramar premar symm; model count = symm extramar premar / dist=poi link=log; *QS; procgenmoddata=sex; class symm; model count = symm extramar premar / dist=poi link=log; * ordinal QS; procgenmoddata=sex; class extramar premar qi; model count = extramar premar qi / dist=poi link=log; * quasi indep; procgenmoddata=sex; class extramar premar; model count = extramar premar unif / dist=poi link=log; run;/*linear-linear association*/ procgenmoddata=sex; class symm; model count = symm tao/ dist=poi link=log; * conditional symmetry; procgenmoddata=sex; class extramar premar qi; model count = extramar premar unif qi/ dist=poi link=log;*quasi uniform association; run; G2=2.09 DF=5 G2=7.04 DF=5 G2=8.32 DF=8 G2=15.5 DF=5 G2=1.43 DF=4

  10. procgenmoddata=sex; class symm; model count = symm extramar premar / dist=poi link=log; * ordinal QS;

  11. data sex1; set sex; ub_a=extramar-premar; if extramar<premar then nab=count; else nab=0; run; procsql; createtable aa as select symm, sum(count) as tcount, max(nab) as n_ab,max(ub_a) as ub_ua, count(symm) as nsumm from sex1 groupby symm having nsumm=2; proclogisticdata=aa; model n_ab/tcount=ub_ua/ noint; run;

  12. Data aa proc genmod data=aa; model n_ab/tcount=/dist=bin link=logit noint; run; /*equivalent to symmetry*/ proc genmod data=aa; model n_ab/tcount=/dist=bin link=logit; run; /*equivalent to conditional symmetry*/

  13. ORDINAL MODELS: procgenmoddata=sex; class symm; model count = symm extramar premar / dist=poi link=log; * ordinal QS; procgenmoddata=sex; class extramar premar; model count = extramar premar unif / dist=poi link=log; run;/*linear-linear association*/ procgenmoddata=sex; class symm; model count = symm tao/ dist=poi link=log; * conditional symmetry; procgenmoddata=sex; class extramar premar qi; model count = extramar premar unif qi/ dist=poi link=log;*quasi uniform association; run; G2=2.09 DF=5 G2=8.32 DF=8 G2=15.5 DF=5 G2=1.43 DF=4

  14. Models Summary of IXI table • Define two variables, such as symm - symmetry qi - quasi indepedence

  15. procgenmoddata=sex; class symm; model count = symm / dist=poi link=log; * symmetry; procgenmoddata=sex; class extramar premar symm; model count = symm extramar premar / dist=poi link=log; *QS; procgenmoddata=sex; class extramar premar qi; model count = extramar premar qi / dist=poi link=log; * quasi indep;

  16. procgenmoddata=sex; class symm; model count = symm extramar premar / dist=poi link=log; * ordinal QS; procgenmoddata=sex; class extramar premar; model count = extramar premar unif / dist=poi link=log; run;/*linear-linear association*/ procgenmoddata=sex; class extramar premar qi; model count = extramar premar unif qi/ dist=poi link=log;*quasi uniform association; run;

  17. procgenmoddata=sex; class symm; model count = symm tao/ dist=poi link=log; * conditional symmetry; Note: symm - symmetry

  18. Symmetry, Ordinal Quasi-symmetry, conditional symmetry • Logistic form

  19. data sex1; set sex; ub_a=extramar-premar; if extramar<premar then nab=count; else nab=0; run; procsql; createtable aa as select symm, sum(count) as tcount, max(nab) as n_ab,max(ub_a) as ub_ua, count(symm) as nsumm from sex1 groupby symm having nsumm=2; proclogisticdata=aa; model n_ab/tcount=ub_ua/ noint; run; /*ordinal QS*/ procgenmoddata=aa; model n_ab/tcount=/dist=bin link=logit; run; /*conditional symmetry*/ procgenmoddata=aa; model n_ab/tcount=/dist=bin link=logit noint; run; /*equivalent to symmetry*/

  20. Log-linear model form

More Related