Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

I'm assuming that a model which was fitted using the Error() function within aov() won't work when using in plot() because you will get more than one error stratum from which you can choose. Now according to this information herehere, one should use the proj() function which will give you the residuals for each error stratum, which then can be used for diagnostic plots.

I'm assuming that a model which was fitted using the Error() function within aov() won't work when using in plot() because you will get more than one error stratum from which you can choose. Now according to this information here, one should use the proj() function which will give you the residuals for each error stratum, which then can be used for diagnostic plots.

I'm assuming that a model which was fitted using the Error() function within aov() won't work when using in plot() because you will get more than one error stratum from which you can choose. Now according to this information here, one should use the proj() function which will give you the residuals for each error stratum, which then can be used for diagnostic plots.

Bounty Ended with 200 reputation awarded by Glen_b
deleted 2 characters in body
Source Link
Stefan
  • 6.6k
  • 1
  • 24
  • 45

I'm assuming that a model which was fitted using the Error() function within aov() won't work when using in plot() because you will get more than one error stratum from which you can choose. Now you couldaccording to this information here, one should use the proj() function which will give you the residuals for each error stratum in a way that allows you to extract them more easily. I found some information here, which then can be used for diagnostic plots.

I'm assuming that a model which was fitted using the Error() function within aov() won't work when using in plot() because you will get more than one error stratum from which you can choose. Now you could use the proj() function which will give you the residuals for each error stratum in a way that allows you to extract them more easily. I found some information here.

I'm assuming that a model which was fitted using the Error() function within aov() won't work when using in plot() because you will get more than one error stratum from which you can choose. Now according to this information here, one should use the proj() function which will give you the residuals for each error stratum, which then can be used for diagnostic plots.

added 416 characters in body
Source Link
Stefan
  • 6.6k
  • 1
  • 24
  • 45

Thus fitted(oats.aov[[4]]) and resid(oats.aov[[4]]) are vectors of length 54 representing fitted values and residuals from the last stratum, based on 54 orthonormal linear functions of the original data vector. It is not possible to associate them uniquely with the plots of the original experiment. The function proj takes a fitted model object and finds the projections of the original data vector onto the subspaces defined by each line in the analysis of variance tables (including, for multistratum objects, the suppressed table with the grand mean only). The result is a list of matrices, one for each stratum, where the column names for each are the component names from the analysis of variance tables.

Thus fitted(oats.aov[[4]]) and resid(oats.aov[[4]]) are vectors of length 54 representing fitted values and residuals from the last stratum, based on 54 orthonormal linear functions of the original data vector. It is not possible to associate them uniquely with the plots of the original experiment.

Thus fitted(oats.aov[[4]]) and resid(oats.aov[[4]]) are vectors of length 54 representing fitted values and residuals from the last stratum, based on 54 orthonormal linear functions of the original data vector. It is not possible to associate them uniquely with the plots of the original experiment. The function proj takes a fitted model object and finds the projections of the original data vector onto the subspaces defined by each line in the analysis of variance tables (including, for multistratum objects, the suppressed table with the grand mean only). The result is a list of matrices, one for each stratum, where the column names for each are the component names from the analysis of variance tables.

added another source that may help to find a solution to the problem
Source Link
Stefan
  • 6.6k
  • 1
  • 24
  • 45
Loading
Included an update regarding plotting residuals in a repeated measures analysis fit by aov().
Source Link
Stefan
  • 6.6k
  • 1
  • 24
  • 45
Loading
added 29 characters in body
Source Link
Stefan
  • 6.6k
  • 1
  • 24
  • 45
Loading
Realized I that my example data frame d3 had twice the number of observations compared to OP's data frame. Fixed this and also included the updated images and mixed anova table.
Source Link
Stefan
  • 6.6k
  • 1
  • 24
  • 45
Loading
Fixed a coding mistake which changed the first part of my answer (see comments).
Source Link
Stefan
  • 6.6k
  • 1
  • 24
  • 45
Loading
Fixed a coding mistake which changed the first part of my answer (see comments).
Source Link
Stefan
  • 6.6k
  • 1
  • 24
  • 45
Loading
added 3 characters in body
Source Link
Stefan
  • 6.6k
  • 1
  • 24
  • 45
Loading
Addressed OP's comment
Source Link
Stefan
  • 6.6k
  • 1
  • 24
  • 45
Loading
deleted 1 character in body
Source Link
Stefan
  • 6.6k
  • 1
  • 24
  • 45
Loading
Added the `mixed()` ANOVA table
Source Link
Stefan
  • 6.6k
  • 1
  • 24
  • 45
Loading
Changed the random term to +(1|subj) and added plots
Source Link
Stefan
  • 6.6k
  • 1
  • 24
  • 45
Loading
Source Link
Stefan
  • 6.6k
  • 1
  • 24
  • 45
Loading