diff --git a/resources/robustness_check_plots.R b/resources/robustness_check_plots.R index e827235..83cd6ca 100644 --- a/resources/robustness_check_plots.R +++ b/resources/robustness_check_plots.R @@ -1,4 +1,4 @@ -library(data.table) +x1library(data.table) library(ggplot2) source('resources/functions.R') @@ -121,16 +121,13 @@ plot.robustness.2.dv <- function(iv, n.annotations=100, n.classifications=5000){ r <- readRDS("robustness_2_dv.RDS") robust_df <- data.table(r[['robustness_2_dv']]) - - #temporary work around a bug in the makefile - ## if('Px' %in% names(robust_df)) - ## robust_df <- robust_df[is.na(Px)] + robust_df <- robust_df[(m==n.annotations) & (N==n.classifications)] new.levels <- c("true"="True","naive"="Naïve","amelia.full"="MI", "mecor"="mecor","gmm"="GMM", "mle"="MLA", "zhang"="PL","feasible"="Feasible") robust_df <- robust_df[,method := new.levels[method]] - robust_df <- robust_df[method != "Feasible"] + p <- .plot.simulation(robust_df, iv=iv, levels=c("True","Naïve","MI", "GMM", "MLA", "PL", "Feasible")) p <- p + facet_wrap(prediction_accuracy~., ncol=4,as.table=F) @@ -155,16 +152,6 @@ plot.robustness.3.iv <- function(iv, n.annotations=200, n.classifications=5000){ robust_df <- robust_df[,method := new.levels[method]] robust_df <- robust_df[(method != "Feasible") & (Bzx==0.3)] robust_df <- robust_df[(method != "PL")] -## robust_df <- robust_df[method=='MLA',method:='Fischer likelihood'] - - ## robust_df_proflik <- robust_df_proflik[(m==n.annotations) & (N==n.classifications)] - ## robust_df_proflik <- robust_df_proflik[,method := new.levels[method]] - - ## robust_df_proflik <- robust_df_proflik[method=='MLA'] - ## robust_df_proflik <- robust_df_proflik[method=='MLA',method:='Profile likelihood'] - ## robust_df_proflik <- robust_df_proflik[method != "Feasible"] - - ## df <- rbind(robust_df, robust_df_proflik) p <- .plot.simulation(robust_df, iv=iv, levels=c("True","Naïve","MI", "GMM","MLA", "PL", "Feasible")) @@ -208,7 +195,6 @@ plot.robustness.4.iv <- function(iv, n.annotations=200, n.classifications=5000){ robust_df <- robust_df[(m==n.annotations) & (N==n.classifications)] robust_df <- robust_df[,method := new.levels[method]] - robust_df <- robust_df[method != "Feasible"] robust_df <- robust_df[,y_bias:=factor(robust_df$y_bias,levels=sort(unique(robust_df$y_bias),decreasing=TRUE))] robust_df <- robust_df[Bzx==1]