Skip to content

Commit

Permalink
Modifications based on the editorial checklist
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederickHuangLin committed Jul 8, 2022
1 parent edf5665 commit bed091c
Show file tree
Hide file tree
Showing 24 changed files with 829 additions and 837 deletions.
1,012 changes: 506 additions & 506 deletions .Rhistory

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .Rproj.user/shared/notebooks/paths
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/Users/huanglin/Google Drive/Methodological Research/03_secom/SECOM-Code-Archive/simulations/complex/secom.R="4D6DAE01"
/Users/huanglin/Google Drive/Methodological Research/03_secom/SECOM-Code-Archive/simulations/concordance/linear.R="CA33CEF3"
/Users/huanglin/Google Drive/Methodological Research/03_secom/SECOM-Code-Archive/simulations/concordance/nonlinear.R="2D4D8054"
/Users/huanglin/Google Drive/Methodological Research/03_secom/SECOM-Code-Archive/simulations/linear/prop.R="1BBDBD29"
/Users/huanglin/Google Drive/Methodological Research/03_secom/SECOM-Code-Archive/simulations/linear/sample.R="B76BCE44"
/Users/huanglin/Google Drive/Methodological Research/03_secom/SECOM-Code-Archive/simulations/linear/secom.R="E8979B6F"
/Users/huanglin/Google Drive/Methodological Research/03_secom/SECOM-Code-Archive/simulations/nonlinear/sample.R="C099902C"
Expand Down
15 changes: 15 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: SECOM-Code-Archive
message: 'If you use this software, please cite it as below.'
type: software
authors:
- given-names: Huang
family-names: Lin
email: huang.lin@nih.gov
affiliation: >-
Eunice Kennedy Shriver National Institute of
Child Health and Human Development
orcid: 'https://orcid.org/0000-0002-4892-7871'
Binary file modified images/main/sim_complex.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/main/sim_complex.pdf
Binary file not shown.
Binary file modified images/main/sim_linear.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/main/sim_linear.pdf
Binary file not shown.
Binary file modified images/main/sim_nonlinear.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/main/sim_nonlinear.pdf
Binary file not shown.
Binary file modified images/supp/supp_diff_corr.pdf
Binary file not shown.
Binary file modified images/supp/supp_impute.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/supp/supp_impute.pdf
Binary file not shown.
Binary file modified images/supp/supp_org_rank.pdf
Binary file not shown.
Binary file modified images/supp/supp_pseudo.pdf
Binary file not shown.
Binary file modified images/supp/supp_sim_complex.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/supp/supp_sim_complex.pdf
Binary file not shown.
Binary file modified images/supp/supp_sim_linear.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/supp/supp_sim_linear.pdf
Binary file not shown.
Binary file modified images/supp/supp_sim_nonlinear.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/supp/supp_sim_nonlinear.pdf
Binary file not shown.
183 changes: 95 additions & 88 deletions programs/02_simulation.Rmd

Large diffs are not rendered by default.

209 changes: 108 additions & 101 deletions programs/02_simulation.html

Large diffs are not rendered by default.

115 changes: 48 additions & 67 deletions programs/05_others.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -612,45 +612,35 @@ res1 = read_csv("../outputs/others/cca_vs_impute_uncorr.csv")
res1$S = factor(res1$S, levels = c("0.1", "0.05", "0.02", "0.01", "0.005"))
df_fig1 = res1 %>%
group_by(S) %>%
summarise(r1 = mean(r_cca, na.rm = TRUE),
std1 = sd(r_cca, na.rm = TRUE),
r2 = mean(r_mice, na.rm = TRUE),
std2 = sd(r_mice, na.rm = TRUE),
r3 = mean(r_gbm, na.rm = TRUE),
std3 = sd(r_gbm, na.rm = TRUE))
df_fig1 = df_fig1 %>%
select(-contains(c("2", "3"))) %>%
rename(r = r1, std = std1) %>%
mutate(type = "CCA") %>%
bind_rows(
df_fig1 %>%
select(-contains(c("1", "3"))) %>%
rename(r = r2, std = std2) %>%
mutate(type = "MICE")
) %>%
bind_rows(
df_fig1 %>%
select(-contains(c("1", "2"))) %>%
rename(r = r3, std = std3) %>%
mutate(type = "GBM")
) %>%
mutate_if(is.numeric, function(x) round(x, 3))
pivot_longer(cols = r_cca:r_gbm, names_to = "measure", values_to = "value") %>%
mutate(
type = case_when(
measure == "r_cca" ~ "CCA",
measure == "r_mice" ~ "MICE",
TRUE ~ "GBM"
)
)
p_impute1 = df_fig1 %>%
ggplot(aes(x = S, y = r, fill = type)) +
geom_bar(stat = "identity", color = "black",
position = position_dodge()) +
geom_errorbar(aes(ymin = r - std, ymax = r + std), width = .2,
position = position_dodge(.9)) +
ggplot(aes(x = S, y = value, fill = type)) +
stat_summary(fun = mean, geom = "bar", position = "dodge", color = "black") +
stat_summary(fun.data = mean_sdl, fun.args = list(mult = 1), color = "black",
geom = "errorbar", width = .3, position = position_dodge(.9)) +
geom_point(aes(x = S), size = .1, alpha = .3,
position = position_jitterdodge(jitter.width = .2, dodge.width = .9)) +
scale_fill_npg(name = NULL) +
guides(fill = guide_legend(override.aes = list(shape = NA))) +
labs(x = "Sampling fraction", y = "Correlation estimate",
title = "Bias of Estimating Zero Correlation Coefficients") +
scale_fill_npg(name = NULL) +
theme_bw() +
theme(plot.title = element_text(hjust = 0.5))
datatable(df_fig1)
df_summ1 = df_fig1 %>%
group_by(type, S) %>%
summarise(r = mean(value, na.rm = TRUE),
std = sd(value, na.rm = TRUE)) %>%
mutate_if(is.numeric, function(x) round(x, 3))
datatable(df_summ1)
```

### Correlated pairs
Expand Down Expand Up @@ -750,56 +740,47 @@ res2 = read_csv("../outputs/others/cca_vs_impute_corr.csv")
res2$S = factor(res2$S, levels = c("0.1", "0.05", "0.02", "0.01", "0.005"))
df_fig2 = res2 %>%
group_by(S) %>%
summarise(r1 = mean(r_cca, na.rm = TRUE),
std1 = sd(r_cca, na.rm = TRUE),
r2 = mean(r_mice, na.rm = TRUE),
std2 = sd(r_mice, na.rm = TRUE),
r3 = mean(r_gbm, na.rm = TRUE),
std3 = sd(r_gbm, na.rm = TRUE))
df_fig2 = df_fig2 %>%
select(-contains(c("2", "3"))) %>%
rename(r = r1, std = std1) %>%
mutate(type = "CCA") %>%
bind_rows(
df_fig2 %>%
select(-contains(c("1", "3"))) %>%
rename(r = r2, std = std2) %>%
mutate(type = "MICE")
) %>%
bind_rows(
df_fig2 %>%
select(-contains(c("1", "2"))) %>%
rename(r = r3, std = std3) %>%
mutate(type = "GBM")
) %>%
mutate_if(is.numeric, function(x) round(x, 3))
pivot_longer(cols = r_cca:r_gbm, names_to = "measure", values_to = "value") %>%
mutate(
type = case_when(
measure == "r_cca" ~ "CCA",
measure == "r_mice" ~ "MICE",
TRUE ~ "GBM"
)
)
p_impute2 = df_fig2 %>%
ggplot(aes(x = S, y = r, fill = type)) +
geom_bar(stat = "identity", color = "black",
position = position_dodge()) +
geom_errorbar(aes(ymin = r - std, ymax = r + std), width = .2,
position = position_dodge(.9)) +
ggplot(aes(x = S, y = value, fill = type)) +
stat_summary(fun = mean, geom = "bar", position = "dodge", color = "black") +
stat_summary(fun.data = mean_sdl, fun.args = list(mult = 1), color = "black",
geom = "errorbar", width = .3, position = position_dodge(.9)) +
geom_point(aes(x = S), size = .1, alpha = .3,
position = position_jitterdodge(jitter.width = .2, dodge.width = .9)) +
scale_fill_npg(name = NULL) +
guides(fill = guide_legend(override.aes = list(shape = NA))) +
scale_y_continuous(limits = c(0, 1), breaks = seq(0, 0.9, 0.2)) +
geom_hline(yintercept = 0.8, linetype = "dashed") +
labs(x = "Sampling fraction", y = "Correlation estimate",
title = "Bias of Estimating Zero Correlation Coefficients") +
scale_fill_npg(name = NULL) +
theme_bw() +
theme(plot.title = element_text(hjust = 0.5))
datatable(df_fig2)
df_summ2 = df_fig2 %>%
group_by(type, S) %>%
summarise(r = mean(value, na.rm = TRUE),
std = sd(value, na.rm = TRUE)) %>%
mutate_if(is.numeric, function(x) round(x, 3))
datatable(df_summ2)
```

### Output

```{r, fig.height=10, fig.width=12}
```{r, fig.height=8, fig.width=10}
p_impute = ggarrange(p_impute1, p_impute2, nrow = 2, labels = c("a", "b"),
common.legend = TRUE, legend = "right")
p_impute
ggsave(plot = p_impute, "../images/supp/supp_impute.pdf", height = 10, width = 12)
ggsave(plot = p_impute, "../images/supp/supp_impute.jpeg", height = 10, width = 12, dpi = 300)
ggsave(plot = p_impute, "../images/supp/supp_impute.pdf", height = 8, width = 10)
ggsave(plot = p_impute, "../images/supp/supp_impute.jpeg", height = 8, width = 10, dpi = 300)
```

# Session information
Expand Down
Loading

0 comments on commit bed091c

Please sign in to comment.