The code below produces an ANOVA summary table:
anova_weather_score = ezANOVA(weather_summary, dv = .(Score), wid = .(SubjectID), within = .(Backlight, TargetColor), between = .(ColorVision), detailed = TRUE)
Mn = mean(weather_summary$Score)
SST = sum((weather_summary$Score - Mn)^2)
print(anova_weather_score)
The output is formatted nicely, like this:
## $ANOVA
## Effect DFn DFd SSn SSd F
## 1 (Intercept) 1 28 3553270.4678 51610.00 1927.7575933
## 2 ColorVision 1 28 7420.9029 51610.00 4.0260662
## 3 Backlight 5 140 153757.6569 39660.61 108.5514016
## 5 TargetColor 2 56 102265.9725 22160.61 129.2133602
## 4 ColorVision:Backlight 5 140 3812.9949 39660.61 2.6919371
## 6 ColorVision:TargetColor 2 56 389.8112 22160.61 0.4925276
## 7 Backlight:TargetColor 10 280 57694.3679 65001.57 24.8523578
## 8 ColorVision:Backlight:TargetColor 10 280 2578.6755 65001.57 1.1107872
But if I use paste0 to try to append the total sum of squares to the output, the paste works but the formatting is ruined, i.e.:
anova_weather_score = ezANOVA(weather_summary, dv = .(Score), wid = .(SubjectID), within = .(Backlight, TargetColor), between = .(ColorVision), detailed = TRUE)
Mn = mean(weather_summary$Score)
SST = sum((weather_summary$Score - Mn)^2)
anova_weather_score = paste0(anova_weather_score, "SST = ", SST)
print(anova_weather_score)
The output looks like this:
[1] "list(Effect = c(\"(Intercept)\", \"ColorVision\", \"Backlight\", \"TargetColor\", \"ColorVision:Backlight\", \"ColorVision:TargetColor\", \"Backlight:TargetColor\", \"ColorVision:Backlight:TargetColor\"), DFn = c(1, 1, 5, 2, 5, 2, 10, 10), DFd = c(28, 28, 140, 56, 140, 56, 280, 280), SSn = c(3553270.46777402, 7420.90293309264,
and ends with:
\"\", \"*\", \"\"))SST = 506353.173845225"
How can I append SST to the table without disturbing its formatting?