Hi, Can someone set me straight as to how to write formulas in R to indicate: complete independence [A][B][C] joint independence [AB][C] conditional independence [AC][BC] nway interaction [AB][AC][BC] ? For example, if I have 4 factors: hair colour, eye colour, age, sex does > mosaicplot( frequency ~ hair + eye + age + sex) mean that the model fitted is of complete independence of all factors [hair][eye][age][sex]? So does > mosaicplot(frequency ~ hair + eye) mean that the model is of conditional independence [hairAgeSex][eyeAgeSex]? How does the operator * as in > mosaicplot( frequency ~ hair * eye) or > mosaicplot( frequency ~ hair * eye + age) equate to in the type of independence model used? Thanks in advance for any elucidation! Gina
Simon Blomberg
2003-Jun-13 00:20 UTC
[R] formula (joint, conditional independence, etc.) - mosaicplots
?formula Simon Blomberg, PhD Depression & Anxiety Consumer Research Unit Centre for Mental Health Research Australian National University http://www.anu.edu.au/cmhr/ Simon.Blomberg at anu.edu.au +61 (2) 6125 3379> -----Original Message----- > From: g [mailto:gina.joue at ucd.ie] > Sent: Friday, 13 June 2003 10:12 AM > To: r-help at stat.math.ethz.ch > Subject: [R] formula (joint, conditional independence, etc.) - > mosaicplots > > > Hi, > > Can someone set me straight as to how to write formulas in R > to indicate: > complete independence [A][B][C] > joint independence [AB][C] > conditional independence [AC][BC] > nway interaction [AB][AC][BC] > ? > > For example, if I have 4 factors: > hair colour, eye colour, age, sex > > does > > mosaicplot( frequency ~ hair + eye + age + sex) > > mean that the model fitted is of complete independence of all factors > [hair][eye][age][sex]? > > So does > > mosaicplot(frequency ~ hair + eye) > mean that the model is of conditional independence > [hairAgeSex][eyeAgeSex]? > > > How does the operator * as in > > mosaicplot( frequency ~ hair * eye) > or > > mosaicplot( frequency ~ hair * eye + age) > equate to in the type of independence model used? > > > Thanks in advance for any elucidation! > > Gina > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help >
David Meyer
2003-Jun-13 07:57 UTC
[R] formula (joint, conditional independence, etc.) - mosaicplots
On 2003.06.13 02:11, g wrote:> Hi, > > Can someone set me straight as to how to write formulas in R to > indicate: > complete independence [A][B][C]Freq ~ A + B + C> joint independence [AB][C]Freq ~ A * B + C> conditional independence [AC][BC]Freq ~ A * C + B * C> nway interaction [AB][AC][BC]Freq ~ A * B * C - A:B:C You might have a look at demo(mosaic) in package vcd. g., -d> ? > > For example, if I have 4 factors: > hair colour, eye colour, age, sex > > does > > mosaicplot( frequency ~ hair + eye + age + sex) > > mean that the model fitted is of complete independence of all factors > [hair][eye][age][sex]? > > So does > > mosaicplot(frequency ~ hair + eye) > mean that the model is of conditional independence > [hairAgeSex][eyeAgeSex]? > > > How does the operator * as in > > mosaicplot( frequency ~ hair * eye) > or > > mosaicplot( frequency ~ hair * eye + age) > equate to in the type of independence model used? > > > Thanks in advance for any elucidation! > > Gina > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > >