### Nov. 11, 2008

Error: could not find function "load.table"
summary(diett)
Case Diet WeightChange
Min. : 4.0 Atkins:68 Min. :-63.383
1st Qu.: 74.5 LEARN :60 1st Qu.:-16.369
Median :149.5 Ornish:59 Median : -5.897
Mean :151.7 Zone :61 Mean : -7.674
3rd Qu.:229.5 3rd Qu.: 1.516
Max. :311.0 Max. : 34.943
attach(diett)
names(diett)
[1] "Case" "Diet" "WeightChange"
plot(density(WeightChange,ker="e"))

# ANOVA Pt. 4, Power analysis

-Cohen's f = measure of effect size for a >=3 group ANOVA test
Cohen's f estimate= f-hat
model <- aov(WeightChange~Diet)
anova(model)
Analysis of Variance Table

Response: WeightChange
Df Sum Sq Mean Sq F value Pr(>F)
Diet 3 1801 600 2.8255 0.03931 *
Residuals 244 51840 212
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
library(MBESS)
F2Rsquare(2,8255,3,244)
Error in F2Rsquare(2, 8255, 3, 244) : unused argument(s) (244)
F2Rsquare(2.8255,3,244)
[1] 0.03357342
Cohen's f = sqrt(Eta-squared/(1 - Eta-squared))

+ Cohen's f = sqrt(Eta-squared/(1 - Eta-squared))
f-hat = sqrt(.034/(1 - .034))
Error in f - hat = sqrt(0.034/(1 - 0.034)) : object "f" not found
f-hat = sqrt(.034/(1 - .034))
Use Gpower to run a power analysis