Dear stata users,
I am approaching statistics and Stata and I have a question involving proportion tests.
I would like to study the relationship between 2 categorical variables, sex and cure, from the dta "cure2" (webuse cure2).
In this dataset I have the variables sex [male, female] and cure [1, 0].
When I use the command "tab sex cure, column row" I obtain the contingency table (2x2) representing the shares of males and females who did and not did the cure.
Now, if I want to test the significance of the females who used the cure and the females who did not use the cure, I can run the following command:
"prtesti 26 .4063 38 .5938" (where 26 and 38 are the sizes of females who used and did not use the cure respectively, and .4063 and .5938 the corresponding shares). This command provides the statistics to reject or not reject the null hypothesis (this link provides an explanation of this: https://www.youtube.com/watch?v=Fptz16CmmkM).
My question is: suppose that the variable cure would be multivariate, having 2 options (0,1,2 : 0=no cure, 1=cure 1 and 2=cure 2). In this case, the contingency table would be 2x3, having two rows (male, female) and three columns (0,1,2).
Now, if I want to repeat the same test of significance, the prtesti command does not allow to do so.
For instance, after altering the variable cure (imposing randomly 0,1,2), suppose I run the same test on the following values:
"prtesti 20 .3125 6 .938 38 .5938" (where 20 and 6 and 38 are the sizes of females who used no cure, used cure 1 and used cure 2 respectively, with their corresponding shares).
However, stata does not allow to perform this.
Would you know which test I could hence run in Stata to detect the relationship between multivariate categorical variables?
Many thanks.
Jack
I am approaching statistics and Stata and I have a question involving proportion tests.
I would like to study the relationship between 2 categorical variables, sex and cure, from the dta "cure2" (webuse cure2).
In this dataset I have the variables sex [male, female] and cure [1, 0].
When I use the command "tab sex cure, column row" I obtain the contingency table (2x2) representing the shares of males and females who did and not did the cure.
Now, if I want to test the significance of the females who used the cure and the females who did not use the cure, I can run the following command:
"prtesti 26 .4063 38 .5938" (where 26 and 38 are the sizes of females who used and did not use the cure respectively, and .4063 and .5938 the corresponding shares). This command provides the statistics to reject or not reject the null hypothesis (this link provides an explanation of this: https://www.youtube.com/watch?v=Fptz16CmmkM).
My question is: suppose that the variable cure would be multivariate, having 2 options (0,1,2 : 0=no cure, 1=cure 1 and 2=cure 2). In this case, the contingency table would be 2x3, having two rows (male, female) and three columns (0,1,2).
Now, if I want to repeat the same test of significance, the prtesti command does not allow to do so.
For instance, after altering the variable cure (imposing randomly 0,1,2), suppose I run the same test on the following values:
"prtesti 20 .3125 6 .938 38 .5938" (where 20 and 6 and 38 are the sizes of females who used no cure, used cure 1 and used cure 2 respectively, with their corresponding shares).
However, stata does not allow to perform this.
Would you know which test I could hence run in Stata to detect the relationship between multivariate categorical variables?
Many thanks.
Jack
Comment