This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| library(lubridate) | |
| d <- read_csv("psychjobwiki.csv") | |
| ms <- d %>% | |
| group_by(year, category) %>% | |
| count() %>% | |
| left_join(d %>% group_by(year) %>% count() %>% rename(total = n)) %>% | |
| mutate(prop = n / total) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| library(BayesFactor) | |
| # simulation-based frequentist power analysis with known ES | |
| ES <- .5 | |
| n_sims <- 100 | |
| ns <- c(2, 5, 10, 20, 50, 100) | |
| sims <- as.tibble(expand.grid(sim = 1:n_sims, | |
| n = ns)) %>% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| conditions <- read_csv("condition_means.csv") | |
| generate_data <- function(condition_df, n_subs = 40, n_trials = 3) { | |
| tibble(speaker = condition_df$speaker, | |
| prior = condition_df$prior, | |
| info = condition_df$info, | |
| experiment = condition_df$experiment, | |
| correct = rbinom(1, n_subs * n_trials, | |
| condition_df$mean_correct), | |
| subid = rep(1:n_subs, n_trials)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from Bio import Entrez | |
| Entrez.email = "[email protected]" | |
| def get_links_term(term): | |
| links = Entrez.esearch(db="pubmed", retmax = 5000, term=term) | |
| record = Entrez.read(links) | |
| link_list = record[u'IdList'] | |
| return link_list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # very quick re-implementation of a loose version of Experiment 1 from | |
| # Twomey & Westermann 2017 | |
| # Mike Frank ([email protected]) | |
| library(autoencoder) | |
| library(tidyverse) | |
| # need this to evaluate pairwise distance in training sets | |
| euclidean_pairwise <- function (x) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| d <- read_csv("~/Desktop/med_table_shavit.csv") %>% | |
| arrange(age_grp, kinship, donation, soc_dist) | |
| # first plot | |
| ggplot(d, | |
| aes(x = soc_dist, y = med_amnt, col = age_grp)) + | |
| geom_point() + | |
| facet_grid(kinship ~ donation) + | |
| geom_smooth(method="lm", formula = y ~ poly(x, 2), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| library(purrr) | |
| n1 = 12 | |
| n2 = 30 | |
| nsims = 10 | |
| get_chi2 <- function(x) { | |
| p1 <- rbinom(1, size = n1, prob = x$p1) | |
| p2 <- rbinom(1, size = n2, prob = x$p2) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(purr) | |
| library(tidyverse) | |
| library(stringr) | |
| # constants | |
| locations <- 1:3 | |
| timestep <- 1 | |
| t_end <- 6 | |
| t <- seq(0, t_end, timestep) |