xz
2007-09-26 20:34:25 UTC
I have three vectors X1, X2, Y and want to find out the possible
dependence of Y on X1 and X2.
Logistic Regression is adopted.
However, I got confused because of the following results:
If I fit the Logitstic Regression model for X1 and Y, or for X2 and Y,
the results show that X1 and Y are clearly correlated, so are X2 and
Y.
fitting model: OddRatio(Y)=a+b1*X1
-------------------------------------------------
Overall Model Fit...
Chi Square= 15.4002; df=1; p= 0.0001
Coefficients and Standard Errors...
Variable Coeff. StdErr p
1 3.3964 1.1342 0.0027
Intercept -0.9985
-------------------------------------------------
fitting model: OddRatio(Y)=a+b2*X2
-------------------------------------------------
Overall Model Fit...
Chi Square= 7.7710; df=1; p= 0.0053
Coefficients and Standard Errors...
Variable Coeff. StdErr p
1 2.1972 0.8819 0.0127
Intercept -0.6931
-------------------------------------------------
However, If I fit the model for all the 3 varibles together, with Y
being dependent variable and X1 and X2 being independent variables,
the p-values are much higher, especially for X2 (0.3288). So can I
still say Y is correlated with X2? How come Y is obviously correlated
with X2 when fitting them separately but not so when fitting all the
variables together?
fitting model: OddRatio(Y)=a+b1*X1+b2*X2
-------------------------------------------------
Overall Model Fit...
Chi Square= 16.3307; df=2; p= 0.0003
Coefficients and Standard Errors...
Variable Coeff. StdErr p
1 2.9453 1.1946 0.0137
2 1.0542 1.0794 0.3288
dependence of Y on X1 and X2.
Logistic Regression is adopted.
However, I got confused because of the following results:
If I fit the Logitstic Regression model for X1 and Y, or for X2 and Y,
the results show that X1 and Y are clearly correlated, so are X2 and
Y.
fitting model: OddRatio(Y)=a+b1*X1
-------------------------------------------------
Overall Model Fit...
Chi Square= 15.4002; df=1; p= 0.0001
Coefficients and Standard Errors...
Variable Coeff. StdErr p
1 3.3964 1.1342 0.0027
Intercept -0.9985
-------------------------------------------------
fitting model: OddRatio(Y)=a+b2*X2
-------------------------------------------------
Overall Model Fit...
Chi Square= 7.7710; df=1; p= 0.0053
Coefficients and Standard Errors...
Variable Coeff. StdErr p
1 2.1972 0.8819 0.0127
Intercept -0.6931
-------------------------------------------------
However, If I fit the model for all the 3 varibles together, with Y
being dependent variable and X1 and X2 being independent variables,
the p-values are much higher, especially for X2 (0.3288). So can I
still say Y is correlated with X2? How come Y is obviously correlated
with X2 when fitting them separately but not so when fitting all the
variables together?
fitting model: OddRatio(Y)=a+b1*X1+b2*X2
-------------------------------------------------
Overall Model Fit...
Chi Square= 16.3307; df=2; p= 0.0003
Coefficients and Standard Errors...
Variable Coeff. StdErr p
1 2.9453 1.1946 0.0137
2 1.0542 1.0794 0.3288