I have the following data set:
| Scenario 1 | Scenario 2 |
|Trial 1|Trial 2| Trial 3|Trial 1|Trial 2| Trial 3|
-------------------------------------------------------------------
S1 | ...
Condition 1 S2 | ...
S3 |
-------------------------------------------------------------------
S5 |
Condition 2 S6 |
S7 |
Thus the Trials
are nested in the Scenarios
and all of them are within subject. I am trying to run an ANOVA on this data set. Here is the model without defining that Scenarios
(and Trials
) are within subject.
my_data.aov <- aov(value~Condition*Trial%in%Scenario,data=my_data) #works fine
But when I specify that these are within subject:
my_data.aov <- aov(value~Condition*Trial%in%Scenario+Error(Player/(Trial%in%Scenario)),data=my_data)
I get the following error
In aov(value ~ Condition * Trial % in % Scenario + Error(Player/(Trial %in% :
Error() model is singular
The closest set-up I could find was Split plot in R but there the subjects are nested inside each Trial
not in each Condition
.
EXAMPLE FILE
Here is an example file in long format.
What about this approach?
If I treat each Trial
as a sample, then I can collapse across Scenarios
by averaging them, so I will have a simpler model, where each Subject
's behavior is described per Scenario
. And since I need to analyze the relationship of value~Condition*Scenario
I can do so by defining the Error
like Error(Subject/Scenario)
.
Will this approach invalidate my analysis?