Class | Analysis and data manipulation command |
Name | tab |
Arguments | [showmiss] [polychoric] [sampleweight <trait>] [<trait 1>...[<trait N>] | (ped <trait>)] |
Print contingency table for one, two or N traits, along with contingency chi-squares, Kruskal-Wallis test or odds ratio if appropriate. For RxC contingency tables where the second variable is a diallelic marker locus, allele frequencies and exact P-values testing Hardy-Weinberg Equilibrium are printed for each level of the first trait.
The default behaviour is to print a one-way table for each active variable. With the plevel at zero, this is a one line table laid out horizontally, but with higher verbosity levels, a full tabulation laid out row by row is printed.
If the showmiss keyword is present, then an additional level indicating that the trait value is missing is included in the table.
The polychoric option will calculate the polychoric correlation for a two-way table.
One can specify for a oneway table for a variable to be printed for each pedigree using the pedigree option, which is supplemented by the Tarone score test for extrabinomial variation if the trait is binary.
Example:
>> include linclex.in >> tab lincl x: 0 y: 16 n: 56 oneperfam x: 0 y: 12 n: 60 D13S162 x: 6 y: 66 (11 unique values 1/4 ...6/8) D13S160 x: 6 y: 66 (13 unique values 1/1 ...5/6) D13S170 x: 14 y: 58 (25 unique values 1/3 ...10/10) >> tab lincl D13S162 ------------------------------------------------ Cross-tabulation of "lincl" ... "D13S162" ------------------------------------------------ lincl D13S162 Count Percent ---------------------------------------- n 1/4 3 4.5 n 1/7 1 1.5 n 2/4 7 10.6 n 2/5 1 1.5 n 3/4 3 4.5 n 4/4 8 12.1 n 4/5 7 10.6 n 4/6 4 6.1 n 4/7 8 12.1 n 4/8 6 9.1 n 6/8 2 3.0 y 2/4 1 1.5 y 4/4 14 21.2 y 4/7 1 1.5 ---------------------------------------- Total 66 (and 6 missing) >> tab D13S162 lincl ------------------------------------------------ Cross-tabulation of "D13S162" ... "lincl" ------------------------------------------------ lincl D13S162 n y Odds Ratio (95%CI) ---------------------------------------------------- 1/4 3 (1.00) 0 (.000) 1.00 1/7 1 (1.00) 0 (.000) 2.33 (0.03--182.92) 2/4 7 (.875) 1 (.125) 1.40 (0.04--43.79) 2/5 1 (1.00) 0 (.000) 2.33 (0.03--182.92) 3/4 3 (1.00) 0 (.000) 1.00 (0.02--66.07) 4/4 8 (.364) 14 (.636) 11.94 (0.55--260.30) 4/5 7 (1.00) 0 (.000) 0.47 (0.01--28.73) 4/6 4 (1.00) 0 (.000) 0.78 (0.01--49.91) 4/7 8 (.889) 1 (.111) 1.24 (0.04--38.30) 4/8 6 (1.00) 0 (.000) 0.54 (0.01--33.47) 6/8 2 (1.00) 0 (.000) 1.40 (0.02--97.44) ---------------------------------------------------- Total 50 [.758] 16 [.242] No. complete observations = 66 LR contingency chi-square = 31.96 Degrees of freedom = 10 Asymptotic P-value = 0.0004 Empiric P-value = 0.0020 (132000 MCMC iterations) Trend chi-square = 0.61 (P=0.4365) >> tab ped lincl Pedigree versus "lincl": Pedigree Affected (Prop) Total Missing ---------- ---------------- -------- ------- 1 2 (0.2857) 7 0 2 2 (0.2222) 9 0 3 2 (0.1818) 11 0 4 1 (0.2500) 4 0 5 0 (0.0000) 5 0 6 1 (0.2500) 4 0 7 0 (0.0000) 4 0 8 1 (0.2000) 5 0 9 1 (0.2500) 4 0 10 1 (0.2500) 4 0 11 1 (0.2500) 4 0 12 1 (0.3333) 3 0 13 2 (0.5000) 4 0 14 1 (0.2500) 4 0 Number of pedigrees = 14 Number of affecteds = 16 Number observed = 72 Proportion affected = 0.2222 Variance Chi-square = 4.96 (df= 13, P=0.9761) Tarone Score Test = 3.38 (P=0.0661) Intraclass correlation = -0.1522 >> count lincl Count where "lincl": Pedigree Con=T Num ASPs Trios 4+ -------------- ------ ------- ------ ------ ------ 1 2 7 1 0 0 2 2 9 1 0 0 3 2 11 0 0 0 4 1 4 0 0 0 6 1 4 0 0 0 8 1 5 0 0 0 9 1 4 0 0 0 10 1 4 0 0 0 11 1 4 0 0 0 12 1 3 0 0 0 13 2 4 1 0 0 14 1 4 0 0 0 Total 16 72 3 0 0 Number of matched persons =16 out of 72 (22.2%) Number of matched pedigrees =12 out of 14 (85.7%)
<< (cov) | Up to index | >> (llm) |