2
$\begingroup$

I want to determine the interaction between two of my continuous (scale) independent variables on the one dependent variable, which is dichotomous (cases are coded as 0 and 1). I was going to use a two-way ANOVA, but you need categorical or continuous independent variables as well as a continuous dependent. Is there any similar test that would work for my variable types?

I was also going to do a logistic regression to determine how my independent variables predict my dependent. However, upon performing the Box-Tidwell test in SPSS, I learned that two of my independent variables do not have a linear relationship with the logit transformation of the dependent. This violates an assumption of performing logistic regression. My options are to either take out the offending variables (I'd prefer not to) or not do the regressions. What is recommended when a logistic regression cannot work?

$\endgroup$
1
  • 2
    $\begingroup$ Welcome to Cross Validated! The second question about the nonlinear relationship is quite a bit different from the first question, and my recommendation is to post that as a distinct question. // In your first problem, if you had a continuous $y$ variable, what would you do? // I’m not sure that you’re doing a chunk test, but if you understand that material, you’ll be in a position where you’re unifying your knowledge of regression and hypothesis testing. $\endgroup$
    – Dave
    Commented Apr 2, 2022 at 20:32

2 Answers 2

5
$\begingroup$

ANOVA actually doesn't require categorical independent variables. The ANOVA tests for a model ask whether the predictors explain any variance in the outcome (that's where the name "analysis of variance" comes from). You can do this with any regression model (including generalized linear models). The type 3 ANOVA F-tests (the default tests in SPSS) will have the same p-value as the corresponding coefficient in the regression model for binary and continuous variables; for categorical variables, the F-test does not correspond to the p-values for the individual dummies. The test for each variable asks whether the inclusion of that variable explains any variance in the outcome after already accounting for the variance explained by the other predictors (i.e., it is an "added last" test). If you want your results to be closer to what you get with typical ANOVA for categorical variables, make sure to re-code your binary independent variable as {-1, 1} rather than {0, 1}.

$\endgroup$
2
$\begingroup$

People have been routinely incorporting nonlinear relationships in binary, ordinal, and polytomous logistic regression since the early 1980s using regression splines. It is not a good idea to use some statistical test to screen the model (which distorts operating characteristics). It's a better idea to pre-specify which continuous predictors are not known to act linearly, and to allow them to be nonlinear. This will result in valid compatibility intervals and p-values. I cover this in detail in RMS.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.