revisions and appendix update
This commit is contained in:
@@ -18,13 +18,13 @@ plot.robustness.1 <- function(iv='x'){
|
||||
baseline_df <- baseline_df[(method=='mle') | (method=='True') | (method=='naive')]
|
||||
robust_df <- robust_df[(method=='mle') | (method=='True')]
|
||||
|
||||
baseline_df[method=='mle',method:='MLE Reported']
|
||||
baseline_df[method=='mle',method:='MLA Reported']
|
||||
robust_df[method=='mle',method:='No Z in Error Model']
|
||||
|
||||
df <- rbind(baseline_df, robust_df, fill=TRUE)
|
||||
df[method=='naive', method:='Naive']
|
||||
df <- df[(N %in% c(1000,5000)) & (m %in% c(200,100))]
|
||||
p <- plot.simulation(df,iv=iv,levels=c('MLE Reported','No Z in Error Model', 'Naive', 'True'))
|
||||
p <- plot.simulation(df,iv=iv,levels=c('MLA Reported','No Z in Error Model', 'Naive', 'True'))
|
||||
grid.draw(p)
|
||||
}
|
||||
|
||||
@@ -44,13 +44,13 @@ plot.robustness.1.checkassumption <- function(iv='x'){
|
||||
baseline_df <- baseline_df[(method=='mle') | (method=='naive')]
|
||||
robust_df <- robust_df[(method=='mle') | (method=='True')]
|
||||
|
||||
baseline_df[method=='mle',method:='MLE Reported']
|
||||
baseline_df[method=='mle',method:='MLA Reported']
|
||||
robust_df[method=='mle',method:='No Z in Error Model']
|
||||
|
||||
df <- rbind(baseline_df, robust_df, fill=TRUE)
|
||||
df[method=='naive', method:='Naive']
|
||||
df <- df[(N %in% c(1000,5000)) & (m %in% c(200,100))]
|
||||
p <- plot.simulation(df,iv=iv,levels=c('MLE Reported','No Z in Error Model', 'Naive', 'True'))
|
||||
p <- plot.simulation(df,iv=iv,levels=c('MLA Reported','No Z in Error Model', 'Naive', 'True'))
|
||||
grid.draw(p)
|
||||
}
|
||||
|
||||
@@ -73,14 +73,14 @@ plot.robustness.1.dv <- function(iv='z'){
|
||||
baseline_df <- baseline_df[(method=='mle') | (method=='True') | (method=='naive')]
|
||||
robust_df <- robust_df[(method=='mle') | (method=='True')]
|
||||
|
||||
baseline_df[method=='mle',method:='MLE Reported']
|
||||
baseline_df[method=='mle',method:='MLA Reported']
|
||||
robust_df[method=='mle',method:='No Z in Error Model']
|
||||
|
||||
df <- rbind(baseline_df, robust_df, fill=TRUE)
|
||||
df <- df[(N %in% c(1000,5000)) & (m %in% c(200,100))]
|
||||
df[method=='naive', method:='Naive']
|
||||
|
||||
p <- plot.simulation(df,iv=iv,levels=c('MLE Reported','No Z in Error Model','Naive', 'True'))
|
||||
p <- plot.simulation(df,iv=iv,levels=c('MLA Reported','No Z in Error Model','Naive', 'True'))
|
||||
grid.draw(p)
|
||||
}
|
||||
|
||||
@@ -91,11 +91,11 @@ plot.robustness.2.iv <- function(iv, n.annotations=100, n.classifications=5000){
|
||||
|
||||
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"="MLE", "zhang"="PL","feasible"="Feasible")
|
||||
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", "MLE", "PL", "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)
|
||||
p <- p + scale_x_discrete(labels=label_wrap_gen(14)) + ylab("Estimate") + xlab("Method") + coord_flip()
|
||||
@@ -123,11 +123,11 @@ plot.robustness.2.dv <- function(iv, n.annotations=100, n.classifications=5000){
|
||||
## 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"="MLE", "zhang"="PL","feasible"="Feasible")
|
||||
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", "MLE", "PL", "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)
|
||||
p <- p + scale_x_discrete(labels=label_wrap_gen(14)) + ylab("Estimate") + xlab("Method") + coord_flip()
|
||||
@@ -139,30 +139,30 @@ plot.robustness.2.dv <- function(iv, n.annotations=100, n.classifications=5000){
|
||||
}
|
||||
|
||||
|
||||
plot.robustness.3.iv <- function(iv, n.annotations=100, n.classifications=5000){
|
||||
plot.robustness.3.iv <- function(iv, n.annotations=200, n.classifications=5000){
|
||||
r <- readRDS('robustness_3.RDS')
|
||||
robust_df <- data.table(r[['robustness_3']])
|
||||
r2 <- readRDS('robustness_3_proflik.RDS')
|
||||
robust_df_proflik <- data.table(r2[['robustness_3_proflik']])
|
||||
|
||||
new.levels <- c("true"="True","naive"="Naïve","amelia.full"="MI", "mecor"="mecor","gmm"="GMM", "mle"="MLE", "zhang"="PL","feasible"="Feasible")
|
||||
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[(m==n.annotations) & (N==n.classifications)]
|
||||
robust_df <- robust_df[,method := new.levels[method]]
|
||||
robust_df <- robust_df[method != "Feasible"]
|
||||
robust_df <- robust_df[method=='MLE',method:='Fischer likelihood']
|
||||
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=='MLE',method:='Profile 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)
|
||||
|
||||
robust_df_proflik <- robust_df_proflik[,method := new.levels[method]]
|
||||
robust_df_proflik <- robust_df_proflik[method != "Feasible"]
|
||||
|
||||
df <- rbind(robust_df, robust_df_proflik)
|
||||
|
||||
p <- .plot.simulation(df, iv=iv, levels=c("True","Naïve","MI", "GMM", "MLE", "PL", "Feasible"))
|
||||
p <- .plot.simulation(robust_df, iv=iv, levels=c("True","Naïve","MI", "GMM","MLA", "PL", "Feasible"))
|
||||
|
||||
p <- p + facet_wrap(Px~., ncol=3,as.table=F)
|
||||
p <- p + scale_x_discrete(labels=label_wrap_gen(14)) + ylab("Estimate") + xlab("Method") + coord_flip()
|
||||
@@ -177,16 +177,17 @@ plot.robustness.3.dv <- function(iv, n.annotations=100, n.classifications=1000){
|
||||
r <- readRDS('robustness_3_dv.RDS')
|
||||
robust_df <- data.table(r[['robustness_3_dv']])
|
||||
|
||||
new.levels <- c("true"="True","naive"="Naïve","amelia.full"="MI", "mecor"="mecor","mle"="MLE", "zhang"="PL","feasible"="Feasible")
|
||||
new.levels <- c("true"="True","naive"="Naïve","amelia.full"="MI", "mecor"="mecor","mle"="MLA", "zhang"="PL","feasible"="Feasible")
|
||||
|
||||
robust_df <- robust_df[(m==n.annotations) & (N==n.classifications)]
|
||||
|
||||
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", "MLE", "PL", "Feasible"))
|
||||
robust_df <- robust_df[,Py := round(plogis(B0),2)]
|
||||
p <- .plot.simulation(robust_df, iv=iv, levels=c("True","Naïve","MI", "GMM", "MLA", "PL", "Feasible"))
|
||||
robust_df <- robust_df[(method != "PL")]
|
||||
|
||||
p <- p + facet_wrap(B0~., ncol=3,as.table=F)
|
||||
p <- p + facet_wrap(Py~., ncol=3,as.table=F,scales='free')
|
||||
p <- p + scale_x_discrete(labels=label_wrap_gen(14)) + ylab("Estimate") + xlab("Method") + coord_flip()
|
||||
|
||||
p <- arrangeGrob(p,
|
||||
@@ -194,20 +195,21 @@ plot.robustness.3.dv <- function(iv, n.annotations=100, n.classifications=1000){
|
||||
|
||||
grid.draw(p)
|
||||
}
|
||||
|
||||
plot.robustness.4.iv <- function(iv, n.annotations=100, n.classifications=1000){
|
||||
r <- readRDS('robustness_4.RDS')
|
||||
robust_df <- data.table(r[['robustness_4']])
|
||||
|
||||
new.levels <- c("true"="True","naive"="Naïve","amelia.full"="MI", "mecor"="mecor","gmm"="GMM", "mle"="MLE", "zhang"="PL","feasible"="Feasible")
|
||||
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[(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))]
|
||||
p <- .plot.simulation(robust_df, iv=iv, levels=c("True","Naïve","MI", "GMM", "MLE", "PL", "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]
|
||||
|
||||
p <- .plot.simulation(robust_df, iv=iv, levels=c("True","Naïve","MI", "GMM", "MLA", "PL", "Feasible"))
|
||||
|
||||
p <- p + facet_wrap(y_bias~., ncol=3,as.table=T)
|
||||
p <- p + scale_x_discrete(labels=label_wrap_gen(14)) + ylab("Estimate") + xlab("Method") + coord_flip()
|
||||
@@ -219,45 +221,21 @@ plot.robustness.4.iv <- function(iv, n.annotations=100, n.classifications=1000){
|
||||
}
|
||||
|
||||
|
||||
|
||||
plot.robustness.4.iv <- function(iv, n.annotations=100, n.classifications=1000){
|
||||
r <- readRDS('robustness_4.RDS')
|
||||
robust_df <- data.table(r[['robustness_4']])
|
||||
|
||||
|
||||
new.levels <- c("true"="True","naive"="Naïve","amelia.full"="MI", "mecor"="mecor","gmm"="GMM", "mle"="MLE", "zhang"="PL","feasible"="Feasible")
|
||||
|
||||
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))]
|
||||
p <- .plot.simulation(robust_df, iv=iv, levels=c("True","Naïve","MI", "GMM", "MLE", "PL", "Feasible"))
|
||||
|
||||
p <- p + facet_wrap(y_bias~., ncol=3,as.table=T)
|
||||
p <- p + scale_x_discrete(labels=label_wrap_gen(14)) + ylab("Estimate") + xlab("Method") + coord_flip()
|
||||
|
||||
p <- arrangeGrob(p,
|
||||
top=grid.text("Coefficient of Y for W",x=0.32,just='right'))
|
||||
|
||||
grid.draw(p)
|
||||
}
|
||||
|
||||
plot.robustness.4.dv <- function(iv, n.annotations=100, n.classifications=1000){
|
||||
r <- readRDS('robustness_4_dv.RDS')
|
||||
robust_df <- data.table(r[['robustness_4']])
|
||||
|
||||
new.levels <- c("true"="True","naive"="Naïve","amelia.full"="MI", "mecor"="mecor","mle"="MLE", "zhang"="PL","feasible"="Feasible")
|
||||
new.levels <- c("true"="True","naive"="Naïve","amelia.full"="MI", "mecor"="mecor","mle"="MLA", "zhang"="PL","feasible"="Feasible")
|
||||
|
||||
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[,z_bias=factor(z_bias, levels=sort(unique(z_bias),descending=TRUE))]
|
||||
robust_df <- robust_df[,z_bias:=factor(z_bias, levels=sort(unique(z_bias),decreasing=TRUE))]
|
||||
|
||||
p <- .plot.simulation(robust_df, iv=iv, levels=c("True","Naïve","MI", "GMM", "MLE", "PL", "Feasible"))
|
||||
robust_df <- robust_df[Bzx==1]
|
||||
p <- .plot.simulation(robust_df, iv=iv, levels=c("True","Naïve","MI", "GMM", "MLA", "PL", "Feasible"))
|
||||
p <- p + facet_wrap(z_bias~., ncol=3,as.table=F)
|
||||
p <- p + scale_x_discrete(labels=label_wrap_gen(14)) + ylab("Estimate") + xlab("Method") + coord_flip()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user