0
$\begingroup$

I am conducting a study looking at the interactive effects of delay group (12h sleep, 12h wake, 5min AM, 5min PM; between subjects) and study condition (reread, practice test without feedback, practice test + feedback; within subjects). The outcome variable of interest is final test performance. Both practice test and final test performance is scored on a 0/1 scale.

I ran an ANOVA to first examine the effects of time of day and study condition on practice test performance. I found that there are significant time of day effects, such that individuals who completed practice testing in the morning had higher scores than individuals who completed practice testing at night.

The key question of interest in my study involves a comparison of the 12h sleep and 12h wake group, and how these delays interact with study condition. As such, I need to control for time of day effects.

I am doing my analyses in R, and was initially planning to run an ANOVA including delay group and study condition as predictors. Given the time of day effects, I changed this plan to run an ANCOVA, adding in time of day as a covariate. However, I have read that covariates must be continuous in nature and the time of day variable is categorical. Is there a way to account for time of day as a control variable in either the ANOVA or ANCOVA? Does anyone have resources that show sample code for this process?

$\endgroup$
1
  • $\begingroup$ You can add a covariate whether it is continuous or categorical. With a categorical covariate, you might not use the name "ancova", but instead just call it a "general linear model". $\endgroup$ Commented Jan 6, 2022 at 18:10

1 Answer 1

0
$\begingroup$

I think you could use a linear mixed model here. A basic example using the lme4 package:

lme4::lmer(performance ~ DelayGroup * StudyCondition + TimeOfDay + (Condition | SubjectID), data)

This would allow you to probe interaction effects for group and condition on the outcome, performance, while accounting for the time of day covariate.

$\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.