The test-negative design is routinely used for the monitoring of seasonal flu vaccine effectiveness. Due to its many important advantages, it has become integral to the estimation of COVID-19 vaccine effectiveness, in particular for more severe disease outcomes. Multivariable logistic regression is typically applied to estimate the conditional risk ratio but is invalid in the presence of effect modification by a confounder. We give and justify an inverse probability of treatment weighting (IPTW) estimator for the marginal risk ratio, which is valid under effect modification. We illustrate the connection between these statistical estimands and causal quantities under partial and null interference. We conduct a simulation study to illustrate and confirm our derivations and to evaluate the performance of the estimators. We find that if the effectiveness of the vaccine varies across patient subgroups, the multivariable logistic regression can lead to highly misleading estimates, but the IPTW estimator can produce unbiased estimates. We also find that in the presence of partial interference both estimators can produce misleading estimates.