ez icon indicating copy to clipboard operation
ez copied to clipboard

Incorrect between_covariate result.

Open slfan2013 opened this issue 7 years ago • 5 comments

The between_covariate result is wrong. We cannot simply take the residual of lm(dv~between_covariate) and regress on other between variables.

For example,

res = lm(dependent_variable~covariate)
lm(res~independent_variable)

is not equivelent to

lm(res~independent_variable + covariate)

The first one will produce a high risk of false discovery.

slfan2013 avatar May 23 '18 22:05 slfan2013

Hm, in my simulations it's the latter that yields a high rate of false alarms, and only in the case where the covariate is correlated with the independent variable, where you're not supposed to be doing regression like that in the first place.

mike-lawrence avatar May 23 '18 22:05 mike-lawrence

Please have a look at https://stats.stackexchange.com/questions/286850/linear-regression-confounder

slfan2013 avatar May 23 '18 23:05 slfan2013

Please have a look at my simulation here, which produces this plot. Feel free to correct any code or interpretation error I've made.

mike-lawrence avatar May 23 '18 23:05 mike-lawrence

No, I am not talking about the high or low risk of type I error. I am saying that the statistic of dealing with covariate in ez package is incorrect. Please see this discussion.

slfan2013 avatar May 29 '18 03:05 slfan2013

That discussion highlights that the method I use is only a problem when the covariate is correlated with one or more predictors, in which case yes, you should be doing multiple regression. I think the problem here is that people use different terminology for these things. ANCOVA was originally intended as merely a means to increase power for the analysis of the relationship between Y~X when there exist measurements for Z which has a known effect on Y but is not correlated with X and does not interact with the effect that X has on Y. When these conditions hold, subtracting the variance associated with the Z effect on Y will improve power to assess the effect that X has on Y. The case where Z & X are correlated or interact is clearly a matter for multiple regression, and the term "ANCOVA" doesn't really make any sense. I will add a warning that appears when users supply covariates to ezANOVA notifying them of the abova assumptions.

-- Mike Lawrence Graduate Student Department of Psychology & Neuroscience Dalhousie University

~ Certainty is (possibly) folly ~

On Tue, May 29, 2018 at 12:54 AM, slfan2013 [email protected] wrote:

No, I am not talking about the high or low risk of type I error. I am saying that the statistic of dealing with covariate in ez package is incorrect. Please see this discussion https://stats.stackexchange.com/questions/286850/linear-regression-confounder .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mike-lawrence/ez/issues/60#issuecomment-392645645, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJM_UfzQS0xmJEJ_rMyG-8xc-0RabCBks5t3MZhgaJpZM4ULSM9 .

mike-lawrence avatar May 29 '18 13:05 mike-lawrence