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("viridis") | |
n <- 100 | |
sd <- 10 | |
cutoffz_r <- qnorm(0.975) * (sd/sqrt(n)) | |
cutoffz_l <- -cutoffz_r | |
min_ES <- 0.28 | |
min_raw <- min_ES*sd |
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
# fake data | |
library(bayesAB) | |
library(MCMCpack) | |
plotInvGamma(2, 2.5) + geom_vline(xintercept = 1) | |
set.seed(8675309) | |
n <- 60 | |
p <- 500 |
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(rstan) | |
library(bayesplot) | |
#code | |
model_code <- " | |
data { | |
int<lower = 2> K; // # of categories | |
vector[K] priorprobs; //prior | |
int<lower=0> n_total_1; //total in group 1 |
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
#---libs--------------------------------------------------- | |
library(ltm) | |
library(jsonlite) | |
library(tidyverse) | |
library(patchwork) | |
library(stargazer) | |
library(rstan) | |
library(brms) | |
library(viridis) | |
library(plotly) |
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
import time | |
def breath(prompt = "Hold------------"): | |
print(prompt) | |
time.sleep(1) | |
for i in range(2,5): | |
print(str(i)) | |
time.sleep(1) | |
breaths = 0 |
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
terms <- c("error", "random", "model", | |
"mixed", "linear", "effects", | |
"variance") | |
probs <- c(0.1,0.1, 0.55, 0.05, 0.05, 0.1, 0.05) | |
new_jargon <- sample(terms, | |
size = sample(c(2,3),1), | |
prob = probs) | |
new_jargon <- paste(new_jargon, collapse = " ") |
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
#libs-------------- | |
library(grid) | |
library(tidyverse) | |
library(ggdark) | |
#funs-------------- | |
irt <- function(a,b,c){ | |
theta <- seq(-10,10, length = 500) | |
exponent <- exp(a*(theta-b)) | |
phat <- c + (1-c)*(exponent/(1 + exponent)) |
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(readr) | |
library(tidyverse) | |
# read in data | |
urlfile <- "https://raw.githubusercontent.com/Z-Unlocked/Unlocked_Challenge_1/main/temperature_change_data_11-29-2021.csv" | |
mydata <-read_csv(url(urlfile)) | |
# filter | |
countries <- c("China", "Germany", "Japan", "United States of America") |
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) | |
# create named list | |
l <- list(x = data.frame(a = rnorm(10), b = rnorm(10)), | |
y = data.frame(a = rnorm(10), b = rnorm(10)), | |
z = data.frame(a = rnorm(10), b = rnorm(10))) | |
for (i in names(l)){ | |
if (i %in% c("x", "y")){ # if the name of the list item is in a specified sublist | |
l[[i]] <- l[[i]] %>% mutate(c = a + 1) # then do the mutate |
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 shiny import App, render, ui, reactive | |
from pathlib import Path | |
# Import modules for plot rendering | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
import pandas as pd |