fname.stem <- 'prediction.formative.500reps.condition2'
    results.frame <- read.csv(file=paste(fname.stem, '.results.csv', sep=''))
results.frame <- na.omit(results.frame)
    a <- aggregate(results.frame[,11], list(Model=results.frame$Model, Condition=results.frame$Condition, SampleSize=results.frame$SampleSize, NumInd=results.frame$NumInd, IndCov=results.frame$IndCov, ErrorVar=results.frame$ErrorVar, PEstimator=results.frame$PEstimator, Inner=results.frame$Inner, Outer=results.frame$Outer), sd)
fname.stem <- 'prediction.formative.500reps.condition0'
results.frame <- read.csv(file=paste(fname.stem, '.results.csv', sep=''))
results.frame <- na.omit(results.frame)
a <- aggregate(results.frame[,11], list(Model=results.frame$Model, Condition=results.frame$Condition, SampleSize=results.frame$SampleSize, NumInd=results.frame$NumInd, IndCov=results.frame$IndCov, ErrorVar=results.frame$ErrorVar, PEstimator=results.frame$PEstimator, Inner=results.frame$Inner, Outer=results.frame$Outer), sd)
fname.stem <- 'prediction.formative.500reps.condition0'
results.frame <- read.csv(file=paste('aggregate.', fname.stem, '.fold.means.csv', sep=''))
results.frame <- na.omit(results.frame)
summary(results.frame)
a <- aggregate(results.frame[,11], list(Model=results.frame$Model, Condition=results.frame$Condition, SampleSize=results.frame$SampleSize, NumInd=results.frame$NumInd, IndCov=results.frame$IndCov, ErrorVar=results.frame$ErrorVar, PEstimator=results.frame$PEstimator, Inner=results.frame$Inner, Outer=results.frame$Outer), sd)
summary(a)
b <- aggregate(a[,10], list(Condition=a$Condition, SampleSize=a$SampleSize, NumInd=a$NumInd, IndCov=a$IndCov, ErrorVar=a$ErrorVar, PEstimator=a$PEstimator, Inner=a$Inner, Outer=a$Outer), mean)
summary(b)
nrow(b)
b <- b[b$Outer != 'AB',]
b <- b[b$Outer != 'BA',]
nrow(b)
library(tables)
t <- tabular(SampleSize * NumInd * ErrorVar ~ Outer * IndCov * (x * mean) * Format(digits=3), data=b)
write.csv.tabular(t, file=paste("Table.", fname.stem, ".RMSE.sd.csv", sep=''))
summary(b)
head(b)
b
t <- tabular(SampleSize * NumInd * ErrorVar ~ Outer * IndCov * (x * mean) * Format(digits=3), data=b)
?tabular
quit()
t <- tabular(SampleSize * NumInd * ErrorVar ~ Outer * IndCov * (x * mean) * Format(digits=3), data=b)
library(tabular)
t <- tabular(SampleSize * NumInd * ErrorVar ~ Outer * IndCov * (x * mean) * Format(digits=3), data=b)
library(tables)
t <- tabular(SampleSize * NumInd * ErrorVar ~ Outer * IndCov * (x * mean) * Format(digits=3), data=b)
t <- tabular(SampleSize * NumInd * ErrorVar ~ Outer * IndCov * (x * 1) * Format(digits=3), data=b)
?tabular
t <- tabular( (mean * SampleSize) * NumInd * ErrorVar ~ Outer * IndCov * (x * mean) * Format(digits=3), data=b)
colnames(b)
t <- tabular( SampleSize * NumInd * ErrorVar ~ Outer * IndCov * Inner * (x * mean) * Format(digits=3), data=b)
t <- tabular( SampleSize * NumInd * ErrorVar ~ Outer * IndCov * Inner * PEstimator * (x * mean) * Format(digits=3), data=b)
t <- tabular( SampleSize * NumInd * ErrorVar ~ Outer * IndCov * Inner * PEstimator * x * Format(digits=3), data=b)
t <- tabular( SampleSize * NumInd * ErrorVar ~ x * Format(digits=3), data=b)
t <- tabular( SampleSize * NumInd * ErrorVar ~ (x*mean) * Format(digits=3), data=b)
t <- tabular( SampleSize * ErrorVar ~ (x*mean) * Format(digits=3), data=b)
t <- tabular( SampleSize ~ (x*mean) * Format(digits=3), data=b)
t <- tabular( SampleSize ~ x * Format(digits=3), data=b)
t <- tabular( SampleSize ~ (mean * x), data=b)
?tabular
t <- tabular( SampleSize ~ 1, data=b)
t
t <- tabular( SampleSize ~ x, data=b)
t <- tabular( SampleSize ~ x * mean, data=b)
t <- tabular( SampleSize * NumInd ~ 1, data=b)
t <- tabular( SampleSize * NumInd ~ 1, data=b)
t
colnames(b)
?tabular
?tabular
t <- tabular( b$SampleSize * b$NumInd ~ 1)
t <- tabular( b$SampleSize ~ 1)
t
t <- tabular( b$IndCov ~ 1)
t
t <- tabular( 1 ~ 1)
fname.stem <- 'prediction.formative.500reps.condition0'
results.frame <- read.csv(file=paste('aggregate.', fname.stem, '.fold.means.csv', sep=''))
results.frame <- na.omit(results.frame)
a <- aggregate(results.frame[,11], list(Model=results.frame$Model, Condition=results.frame$Condition, SampleSize=results.frame$SampleSize, NumInd=results.frame$NumInd, IndCov=results.frame$IndCov, ErrorVar=results.frame$ErrorVar, PEstimator=results.frame$PEstimator, Inner=results.frame$Inner, Outer=results.frame$Outer), sd)
b <- aggregate(a[,10], list(Condition=a$Condition, SampleSize=a$SampleSize, NumInd=a$NumInd, IndCov=a$IndCov, ErrorVar=a$ErrorVar, PEstimator=a$PEstimator, Inner=a$Inner, Outer=a$Outer), mean)
b <- b[b$Outer != 'AB',]
b <- b[b$Outer != 'BA',]
b$ErrorVar <- as.factor(b$ErrorVar)
b$IndCov <- as.factor(b$IndCov)
b$NumInd <- as.factor(b$NumInd)
b$SampleSize <- as.factor(b$SampleSize)
b
is.factor(b$SampleSize)
levels(b$SampleSize)
?tables
?tabular
t <- tabular(b$SampleSize + 1 ~ b$x)
t
t <- tabular(b$SampleSize ~ b$x)
t
t <- tabular(b$SampleSize ~ b$x * mean)
t
t <- tabular(b$SampleSize + b$NumInd ~ b$x * mean)
t
t <- tabular(b$SampleSize * b$NumInd ~ b$x * mean)
t
t <- tabular(b$SampleSize * b$NumInd * b$ErrorVar ~ b$x * mean)
t
t <- tabular(b$SampleSize * b$NumInd * b$ErrorVar ~ b$Outer * (b$x * mean)))
t <- tabular(b$SampleSize * b$NumInd * b$ErrorVar ~ b$Outer * (b$x * mean))
t
t <- tabular(b$SampleSize * b$NumInd * b$ErrorVar ~ b$Outer * b$IndCov * (b$x * mean))
t
t <- tabular(b$SampleSize * b$NumInd * b$ErrorVar ~ b$Outer * b$IndCov * (b$x * mean) * Format(digits=3))
t
t <- tabular(b$SampleSize * b$NumInd * b$ErrorVar ~ b$Outer * b$IndCov * (b$x * mean) * Format(digits=2))
t
t <- t[, -c(7:9, 13:15)]
t
t <- tabular(b$SampleSize * b$NumInd * b$ErrorVar ~ b$Outer * b$IndCov * (b$x * mean) * Format(digits=2))
str(t)
t
t <- t[, -c(4:6, 10:12)]
t
write.csv.tabular(t, file=paste("Table.", fname.stem, ".RMSE.sd.csv", sep=''))
t <- tabular(b$SampleSize * b$NumInd * b$ErrorVar ~ b$Outer * b$IndCov * (b$x * mean) * Format(digits=1))
t
t <- t[, -c(4:6, 10:12)]
write.csv.tabular(t, file=paste("Table.", fname.stem, ".RMSE.sd.csv", sep=''))
t
write.csv.tabular(t, file=paste("Table.", fname.stem, ".RMSE.sd.csv", sep=''))
quit()
d <- read.csv('aggregate.prediction.formative.500reps.condition0.grand.means.csv')
d
nrow(d)
colnames(d)
d <- d[Outer != 'AB',]
d <- d[d$Outer != 'AB',]
d <- d[d$Outer != 'BA',]
nrow(d)
d
colnames(d)
summary(d)
summary(lm(x~NumInd, data=d))
summary(lm(x~SampleSize + NumInd, data=d))
summary(lm(x~SampleSize + NumInd, data=d), digits=3)
summary(lm(x~SampleSize + NumInd, data=d), digits=2)
summary(lm(x~SampleSize + NumInd, data=d))
summary(lm(x~NumInd, data=d))
summary(lm(x~SampleSize, data=d))
summary(lm(x~SampleSize + NumInd, data=d))
summary(lm(x~(SampleSize + NumInd) * ErrorVar, data=d))
summary(lm(x~(SampleSize + NumInd), data=d[d$ErrorVar==0,]))
summary(lm(x~(SampleSize + NumInd), data=d[d$ErrorVar==0.1,]))
summary(lm(x~(SampleSize + NumInd), data=d[d$ErrorVar==0.4,]))
summary(lm(x~(SampleSize + NumInd), data=d[d$IndCov==0,]))
summary(lm(x~(SampleSize + NumInd), data=d[d$IndCov==0.1,]))
summary(lm(x~(SampleSize + NumInd), data=d[d$IndCov==0.4,]))
summary(lm(x~(SampleSize + NumInd) * IndCov, data=d))
summary(lm(x~(SampleSize + NumInd), data=d[d$Outer='ML',]))
levels(d$Outer)
summary(lm(x~(SampleSize + NumInd), data=d[d$Outer=='ML',]))
summary(lm(x~(SampleSize + NumInd), data=d[d$Outer=='LM',]))
summary(lm(x~(SampleSize + NumInd), data=d[d$Outer=='A',]))
summary(lm(x~(SampleSize + NumInd), data=d[d$Outer=='B',]))
summary(lm(x~(SampleSize + NumInd), data=d))
plot(d$x ~ d$SampleSize)
?lines
plot(d$x ~ d$SampleSize)
plot(d$x ~ d$NumInd)
summary(lm(x~IndCov), data=d[d$Outer=='A',]))
summary(lm(x~IndCov), data=d[d$Outer=='A',])
summary(lm(x~IndCov, data=d[d$Outer=='A',]))
summary(lm(x~IndCov, data=d[d$Outer=='B',]))
summary(lm(x~IndCov, data=d[d$Outer=='LM',]))
summary(lm(x~IndCov, data=d[d$Outer=='ML',]))
mean(d[d$Outer=='ML',x])
mean(d[d$Outer=='ML',]$x)
mean(d[d$Outer=='ML',]$x)
mean(d[d$Outer=='LM',]$x)
mean(d[d$Outer=='A',]$x)
mean(d[d$Outer=='B',]$x)
summary(lm(x~ErrorVar, data=d))
summary(lm(x~SampleSize + NumInd, data=d))
str(summary(lm(x~SampleSize + NumInd, data=d)))
for (z in levels(d$Outer)) {
  print(summary(lm(x~SampleSize + NumInd, data=d[d$Outer==z,]))$coefficients)
}
 ?levels
?relevel
 ?levels
?reorder
d$Outer <- droplevels(d$Outer)
levels(d$Outer)
for (z in levels(d$Outer)) {
  print(summary(lm(x~SampleSize + NumInd, data=d[d$Outer==z,]))$coefficients)
}
for (z in levels(d$Outer)) {
  print(z)
  print(summary(lm(x~SampleSize + NumInd, data=d[d$Outer==z,]))$coefficients)
}
 print("Overall:")
print(summary(lm(x~SampleSize + NumInd, data=d))$coefficients)
for (z in levels(d$Outer)) {
  print(z)
  print(summary(lm(x~ErrorVar, data=d[d$Outer==z,]))$coefficients)
}
print("Overall:")
print(summary(lm(x~ErrorVar, data=d))$coefficients)
d <- read.csv('aggregate.prediction.formative.500reps.condition0.grand.means.csv')
d <- d[Outer != 'AB',]
d <- d[Outer != 'BA',]
d$Outer <- droplevels(d$Outer)
for (z in levels(d$Outer)) {
  print(z)
  print(summary(lm(x~SampleSize + NumInd, data=d[d$Outer==z,]))$coefficients)
}
print("Overall:")
print(summary(lm(x~SampleSize + NumInd, data=d))$coefficients)
for (z in levels(d$Outer)) {
  print(z)
  print(summary(lm(x~ErrorVar, data=d[d$Outer==z,]))$coefficients)
}
print("Overall:")
print(summary(lm(x~ErrorVar, data=d))$coefficients)
d <- read.csv('aggregate.prediction.formative.500reps.condition0.grand.means.csv')
d <- d[d$Outer != 'AB',]
d <- d[d$Outer != 'BA',]
d$Outer <- droplevels(d$Outer)
for (z in levels(d$Outer)) {
  print(z)
  print(summary(lm(x~SampleSize + NumInd, data=d[d$Outer==z,]))$coefficients)
}
print("Overall:")
print(summary(lm(x~SampleSize + NumInd, data=d))$coefficients)
for (z in levels(d$Outer)) {
  print(z)
  print(summary(lm(x~ErrorVar, data=d[d$Outer==z,]))$coefficients)
}
print("Overall:")
print(summary(lm(x~ErrorVar, data=d))$coefficients)
d <- read.csv('aggregate.prediction.formative.500reps.condition0.grand.means.csv')
d <- d[d$Outer != 'AB',]
d <- d[d$Outer != 'BA',]
d$Outer <- droplevels(d$Outer)
for (z in levels(d$Outer)) {
  print(z)
  print(summary(lm(x~SampleSize + NumInd, data=d[d$Outer==z,]))$coefficients)
}
print("Overall:")
print(summary(lm(x~SampleSize + NumInd, data=d))$coefficients)
for (z in levels(d$Outer)) {
  print(z)
  print(summary(lm(x~ErrorVar, data=d[d$Outer==z,]))$coefficients)
}
print("Overall:")
print(summary(lm(x~ErrorVar, data=d))$coefficients)
for (z in levels(d$Outer)) {
  print(z)
  print(summary(lm(x~IndCov, data=d[d$Outer==z,]))$coefficients)
}
print("Overall:")
print(summary(lm(x~IndCov, data=d))$coefficients)
d <- read.csv('aggregate.prediction.formative.500reps.condition0.grand.means.csv')
d <- d[d$Outer != 'AB',]
d <- d[d$Outer != 'BA',]
d$Outer <- droplevels(d$Outer)
for (z in levels(d$Outer)) {
  print(z)
  print(summary(lm(x~SampleSize + NumInd, data=d[d$Outer==z,]))$coefficients)
}
print("Overall:")
print(summary(lm(x~SampleSize + NumInd, data=d))$coefficients)
for (z in levels(d$Outer)) {
  print(z)
  print(summary(lm(x~ErrorVar, data=d[d$Outer==z,]))$coefficients)
}
print("Overall:")
print(summary(lm(x~ErrorVar, data=d))$coefficients)
for (z in levels(d$Outer)) {
  print(z)
  print(summary(lm(x~IndCov, data=d[d$Outer==z,]))$coefficients)
}
print("Overall:")
print(summary(lm(x~IndCov, data=d))$coefficients)
for (z in levels(d$Outer)) {
  print(z)
  print(mean(d[d$Outer==z,]$x))
}
print("Overall:")
print(mean(d$x))
?matrix
s.means <- matrix(0, nrow=nlevels(d$Outer), ncol=2)
colnames(s.means) <- c('n', 'RMSE')
s.means
for (i in 1:nlevels(d$x)) {
aggregate(d$x, d$Outer, FUN=mean)
?ave
ave(d$x, d$Outer, FUN=mean)
?ave
warpbreaks
ave(warpbreaks$breaks, warpbreaks$wool)
?ave
plot(warpbreask$breaks)
plot(warpbreaks$breaks)
?ave
?lines
lines(ave(warpbreaks$breaks, warpbreaks$wool), type='s')
lines(ave(warpbreaks$breaks, warpbreaks$wool, warpbreaks$tension), type='s')
?lines
?lines
?ave
?unique
unique(ave(d$x, d$Outer, FUN=mean))
unique(cbind(d$Outer, ave(d$x, d$Outer, FUN=mean))(
unique(cbind(d$Outer, ave(d$x, d$Outer, FUN=mean)))
d$Outer
ave(d$x, d$Outer, FUN=mean)
cbind(d$Outer, ave(d$x, d$Outer, FUN=mean))
cbind(levels(d$Outer)[d$Outer], ave(d$x, d$Outer, FUN=mean))
unique(cbind(levels(d$Outer)[d$Outer], ave(d$x, d$Outer, FUN=mean)))
unique(cbind(d$SampleSize, ave(d$x, d$SampleSize, FUN=mean)))
unique(cbind(d$SampleSize, ave(d$x, d$SampleSize, FUN=mean)))
unique(cbind(d$NumInd, ave(d$x, d$NumInd, FUN=mean)))
unique(cbind(d$ErrorVar, ave(d$x, d$ErrorVar, FUN=mean)))
for (z in levels(d$Outer)) {
  print(z)
  print(summary(lm(x~ErrorVar, data=d[d$Outer==z,]))$coefficients)
}
print("Overall:")
print(summary(lm(x~ErrorVar, data=d))$coefficients)
quit()
