Simulation exercise

Group 7:

Vineet kr. Kamal, Philippe Tadger, Ivo Strebeli, Turki Althunian, Talal Alshihyb, Markus Harboe.

library(ggplot2)

v.SS<-c(5,10,15,20,30)
# They suggested to show som sample data from some of the iterations to see how skewed the data were
ggplot(df[which(df$sample %in% v.SS),],aes(x=A,group=k, color=k))  + geom_density() + theme_classic() +
  coord_cartesian(ylim=c(0, 0.20)) + theme(legend.position="bottom", axis.title.x = element_blank(),
                                           plot.margin = margin()) + xlab("df")

 ggplot(output[which(output$sample %in% v.SS),], aes(x=k,y=sig,color=factor(sample),group=factor(sample))) + stat_summary(fun.data=mean_cl_normal, position=position_dodge(width=0.4)) + geom_hline(yintercept=0.05, color="red") +
  stat_summary(fun=mean,geom="line", position=position_dodge(width=0.4)) +
  theme_classic() + ylab("Type-1-error") + labs(color="Sample in each group") +
  theme(legend.position="bottom",plot.margin=margin()) + ggtitle("Results")
## Warning: Computation failed in `stat_summary()`:

 ggplot(output[which(output$sample %in% v.SS),], aes(x=k,y=estA-estB,color=factor(sample),group=factor(sample))) + stat_summary(fun.data=mean_cl_normal, position=position_dodge(width=0.4)) + geom_hline(yintercept=0.05, color="red") +
  stat_summary(fun=mean,geom="line", position=position_dodge(width=0.4)) +
  theme_classic() + ylab("Type-1-error") + labs(color="Sample in each group") +
  theme(legend.position="bottom",plot.margin=margin()) + ggtitle("Results")
## Warning: Computation failed in `stat_summary()`:

output$dif<-output$estA-output$estB
library(rgl)
library(rglwidget)
rgl::plot3d(z=output$dif, y= output$k, x=output$sample)
#rglwidget(z=output$dif, y= output$k, x=output$sample)

# main = "Car Weight Vs Engine Displacement Vs Mileage",sub="3-D Plot")
rgl::plot3d(z=output$sig, y= output$k, x=output$sample)
#rglwidget(z=output$sig, y= output$k, x=output$sample)