Hi Ali, Is there really no order to the 9 X categories? What is X?
But anyway
the table looks like this:
table(df)
Y
X 0 1 2 3
20100 4 1 2 1
20200 4 2 0 0
20300 30 7 5 4
20400 10 4 2 0
20500 32 5 4 2
20600 21 5 2 1
20700 51 11 4 1
20800 59 5 2 6
20900 33 3 2 1
So there are a lot more subjects with X codes above 20200, but there is no
apparent effect of X-level on Y level: Y0 is common for all values of X, and Y3
less so
Hence:
chisq.test(table(df)) X-squared = 25.7405, df = 24, p-value = 0.3665
Best wishes,
tim
On 4 Oct 2012, at 10:21 AM, Ali Zanaty [email protected] wrote: Here are the
data:(any help will be appreciated).I am not sure if I did it right.
Forwarded Message Dear All: I have two variables: X (nominal categorical)
has 9 categories. Y(ordinal categorical) has 4 categories.
1-I fit a logistic regression using Y as the response variable and X as the
independent variable. The P VALUE was 0.2373. This tells me that the
independent variable X is NOT significant predictor.
2- I run a chi-square test to test if there is a relationship (association
ship) between both X and Y variables. The P VALUE was 0.0013. That is there is
statistical evidence of association between the two variables.
3- I collapsed the 4 categories of the Y-variable into 2 categories. I run a
chi-square test to test if there is a difference(s) among proportions of the
X-variable (the equality of the 9 proportions). The P VALUE was 0.0037. That is
there is statistical evidence of differences among the 9 proportions.
On 4 Oct 2012, at 10:21 AM, Ali Zanaty <[email protected]> wrote:
> Here are the data:(any help will be appreciated).I am not sure if I did it
> right.
> ----- Forwarded Message -----
> Dear All:
> I have two variables:
> X (nominal categorical) has 9 categories.
> Y(ordinal categorical) has 4 categories.
>
> 1-I fit a logistic regression using Y as the response variable and X as the
> independent variable. The P VALUE was
> 0.2373. This tells me that the independent variable X is NOT significant
> predictor.
>
> 2- I run a chi-square test to test if there is a relationship (association
> ship) between
> both X and Y variables. The P VALUE was 0.0013. That is there is statistical
> evidence of association between the two variables.
>
> 3- I collapsed the 4 categories of the Y-variable into 2 categories. I run a
> chi-square test to test if there is a difference(s) among proportions of the
> X-variable (the equality of the 9 proportions). The P VALUE was 0.0037. That
> is there is statistical
> evidence of differences among the 9 proportions.
[[alternative HTML version deleted]]
_______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-teaching