Hi all,
I'm fairly new to Stata, and I have encountered a problem I hope you can help me solve.
In essence, I have a two-way table: on the one axis, parental status (low and high, respectively) and on the other, offspring status (low and high).
I produce the table, and it gives me four numbers of observations, e.g.
1652 9820
6520 1360
Then I would like to use the CSI (relative odds/risk ratio) based on these numbers. If I enter it manually, it would look like this:
csi 1652 9820 6520 1360, or
Since I will have to do this for many different sets (geographical units), I do not have time to read the tables and manually enter these numbers into the csi function. Also, doing so involves a great amount of risk that I'll make mistakes along the way.
Can anyone please help me automate this so that Stata knows I want the numbers from the table?
I have tried for hours and hours, and I have used the tab option matcell, but when entering:
csi matname[1,1] matname[1,2] matname[2,1] matname[2,2], or
I get the following error: matcellname found where integer expected. Curiously, I can say, e.g.: di matcellname[1,2] + matcellname[2,2] and get the correct result.
Any help would be greatly appreciated!
Chris
I'm fairly new to Stata, and I have encountered a problem I hope you can help me solve.
In essence, I have a two-way table: on the one axis, parental status (low and high, respectively) and on the other, offspring status (low and high).
I produce the table, and it gives me four numbers of observations, e.g.
1652 9820
6520 1360
Then I would like to use the CSI (relative odds/risk ratio) based on these numbers. If I enter it manually, it would look like this:
csi 1652 9820 6520 1360, or
Since I will have to do this for many different sets (geographical units), I do not have time to read the tables and manually enter these numbers into the csi function. Also, doing so involves a great amount of risk that I'll make mistakes along the way.
Can anyone please help me automate this so that Stata knows I want the numbers from the table?
I have tried for hours and hours, and I have used the tab option matcell, but when entering:
csi matname[1,1] matname[1,2] matname[2,1] matname[2,2], or
I get the following error: matcellname found where integer expected. Curiously, I can say, e.g.: di matcellname[1,2] + matcellname[2,2] and get the correct result.
Any help would be greatly appreciated!
Chris
Comment