[R] testing effects of quantitative predictors on a categorical response variable

Avril Coghlan avril.coghlan at ucd.ie
Wed Jun 9 12:34:46 CEST 2004


   I have a small statistics question, and
as I'm quite new to statistics and R, I'm not
sure if I'm doing things correctly. 

   I am looking at two quantitative
variables (x,y) that are correlated. 
When I divide the data set according to a categorical
variable z, then x and y are more poorly correlated
when z = A than when z = B (see attached figure).
In fact x and y are two (correlated) predictor
variables and z is a categorical response variable that
x and y affect.

   I would like to use R to make some statistical
test to show that you seem to get z = A when
the value of x is much less than y, while you
tend to get z = B when x is approximately the same as y. 
Can anybody tell me what I should be doing?
I tried a logistic regression:
> glm1 <- glm(z ~ y + x,family=binomial(),trace=T)
which gives Pr(>|z|) < 0.01 for both x and y, but
I'm not sure if this is valid to do, since x and y are correlated?

As well this test does not show that it is for values of
x << y that we tend to get z = A, and that for
values of x approx = y, that we tend to get z = B. I'm
not sure how to show this?
I'll be very grateful if anyone can help.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: avril.ps
Type: application/postscript
Size: 8001 bytes
Desc: not available
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20040609/ea3dee5c/avril.ps

More information about the R-help mailing list