<br><br><div><span class="gmail_quote">2007/4/19, Thomas Friedrichsmeier <<a href="mailto:thomas.friedrichsmeier@ruhr-uni-bochum.de">thomas.friedrichsmeier@ruhr-uni-bochum.de</a>>:</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>> Here are my thoughts. (Limited responsibility, because there is some time<br>> passed since I wrote it nd I do not remember all the things I thought then<br>> plus I do not have an SPSS right now).<br>> 1. A small problem we have to see. If we use more than two variables the
<br>> format of the result changes. As I remember of the SPSS crosstabulation<br>> they have one dependent and many independent variables. In this way we<br>> could crosstabulate the dependent with each independent and then put them
<br>> in a table. Do you find this a sound solution?<br><br>I don't think table() has the notion of dependent and independent variables at<br>all. It simply generates all combinations of levels, and then counts, how
<br>often those occur. xtabs() can do the same, or alternatively sum up the<br>values in an additional field (which will typically already contain counts).<br>Is that what you had in mind?</blockquote><div><br>The problem is not exactly the output format, but the results. Sorry, but the data I have can not be dismissed for now. I 'll try to give an example. If we use table for three variables which have 3 values we will get as results:
<br><br>For variable3 value1<br>the table of variable 1 variable2<br><br>For variable3 value2<br>
the table of variable 1 variable2<br><br>For variable3 value3<br>
the table of variable 1 variable2<br><br>Using ftable we get more fancy results<br><br>Variable 1 Variable 2 Varable3 Value1 Value2 Value3<br>Value1      Value1<br>                Value2<br>                Value3<br>Value2     Value1
<br>
                Value2<br>
                Value3<br>Value3      Value1<br>
                Value2<br>
                Value3<br><br>This is better, but can not be plotted. Both have problems using many variables.<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I think the output format is something to worry about last. rk.print() will<br>already handle 3+ dimensional tables, and in light of the next issues, we may<br>have to break up the table for 3 or more dimensions, anyway. I'd say, for
<br>now, let's think about what would be nice, without worrying too much about<br>the details.<br><br>> 2. SPSS also does one barplot for every crosstabulation. With the above<br>> solution is easiest to be done for ever pair dependent-independent we have.
<br>> The only minus is that we have to stop offering preview, something  logical<br>> because here we have an analysis, not a plotting plugin.<br><br>We could still offer a preview for the first table (ok, now I am slightly
<br>worried about how to code this, but it should be doable).<br><br>> 3. Same with chisquare test.<br><br>Yes, this would need to be calculated for each 2 dimensional slice,<br>separately.<br><br></blockquote></div>The way I thought to implement all three parts (using "dependent" and "independent" variables) is something like this pseudocode:
<br>for (i=0; i<length(independents), ++i){<br>table (dependent, independents[i])<br>barplot (table (dependent, independent[i]))<br>chisq.test (dependent, independent[i])<br>}<br><br>I do not know how doable is this. I also do not know if we can and how to count the number of the "independent" variables. How do you see this idea?
<br><br>(To explain the way I use "depenedent" and "independent", I mean as independent a variable that explains the dependent. Eg. I would like to see if how often going to the gym has a relationship and in what extend with heart attacks. In this way heart attacks are "dependent" of "independent" variable "how often going to he gym".)
<br><br>Regards,<br>Ilias<br><br>