I recently got started with R. I would like to carry out a log-linear analysis of a 2x2x2 table. All i have are the categories and frequencies. How do I get this data into R?
I know that the function table() can make contingency tables out of data, the thing is, I already have the contingency table. The question now is how to correctly represent it in R.
So far, I have the following table:
>g1
c1 c2 c1 c2
a1 10 20 50 20
a2 5 40 30 25
>
Now, above the c1 & c2 there should be a b1 and b2.
This is obviously not the correct format for the analyses, since b1 and b2 are not included.
I hope this question is not stupid, but I could not find a single good answer on the net.
You can change the
dimattribute of your current table: