This file contains 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
#function for finding correction correlations with CIs | |
cRRr_CI = function(x, y, x_SD_U, R = 1000, conf = .95, type = "basic") { | |
library(boot);library(psychometric);library(magrittr);library(weights) | |
#make df | |
data = data.frame(x, y) | |
#uncorrected r | |
v_r = wtd.cors(data[[1]], data[[2]]) %>% as.numeric() | |
This file contains 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(pacman) | |
p_load(stringr, psych, kirkegaard, psychometric) | |
# data -------------------------------------------------------------------- | |
d_table = read.csv("chorion_data.csv", row.names = 1) | |
# extract data ------------------------------------------------------------ | |
#find MC and DC rows |
This file contains 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
#!/bin/bash | |
for ID in {1..56} | |
do | |
#pad 0's | |
size = ${#ID} | |
if [ $size == 1 ] | |
then | |
ID = "0" + $ID | |
fi |
This file contains 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(pacman) | |
p_load(curl, kirkegaard) | |
# fetch lists of stations ------------------------------------------------- | |
for (i in 1:56) { | |
message(i) | |
#if i < 10, pad 0 |
This file contains 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
### re-analyze Beaver and Wright's correlation matrix | |
library(magrittr) | |
# load data --------------------------------------------------------------- | |
#load matrix | |
d_bw = structure(list(IQ = c(1, -0.4, -0.44, -0.29, -0.51, -0.58, -0.54, -0.52, -0.53, -0.49, -0.43, -0.56, -0.27, -0.46, -0.38), Property.crime = c(-0.4, 1, 0.95, 0.97, 0.76, 0.77, 0.69, 0.72, 0.93, 0.32, 0.44, 0.56, 0.12, 0.13, 0.16), Burglary = c(-0.44, 0.95, 1, 0.88, 0.7, 0.79, 0.68, 0.75, 0.92, 0.46, 0.56, 0.64, 0.25, 0.27, 0.27), Larceny = c(-0.29, 0.97, 0.88, 1, 0.59, 0.64, 0.53, 0.62, 0.83, 0.27, 0.42, 0.5, 0.13, 0.05, 0.09), Motor.vehicle.theft = c(-0.51, 0.76, 0.7, 0.59, 1, 0.84, 0.88, 0.69, 0.89, 0.19, 0.18, 0.44, -0.09, 0.13, 0.14), Violent.crime = c(-0.58, 0.77, 0.79, 0.64, 0.84, 1, 0.91, 0.93, 0.94, 0.57, 0.6, 0.76, 0.23, 0.46, 0.39), Robbery = c(-0.54, 0.69, 0.68, 0.53, 0.88, 0.91, 1, 0.7, 0.87, 0.36, 0.38, 0.62, 0.03, 0.28, 0.23), Aggravated.assault = c(-0.52, 0.72, 0.75, 0.62, 0.69, 0.93, 0.7, 1, 0.86, 0.66, 0.69, 0.76, 0.36, 0.55, 0 |
This file contains 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(pacman) | |
p_load(kirkegaard, magrittr, ggplot2) | |
# example dataset --------------------------------------------------------- | |
set.seed(1) | |
iris_miss = df_addNA(iris) | |
# amount ------------------------------------------------------------------ |
This file contains 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(pacman) | |
p_load(haven, dplyr, kirkegaard) | |
# load data --------------------------------------------------------------- | |
entiredata = read.csv("Woodcock-Johnson Murray_2007.csv") | |
# subset ------------------------------------------------------------------ | |
#only first two races, and two other conditions | |
d = subset(entiredata, racesample < 3 & wj == 1 & sample == 1) |
This file contains 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(pacman) | |
p_load(ggplot2, dkstat, stringr, plyr, kirkegaard) | |
#install kirkegaard and dkstat from github if needed | |
#library("devtools") | |
#install_github("deleetdk/kirkegaard") | |
#install_github("rOpenGov/dkstat") | |
# load data --------------------------------------------------------------- | |
#get meta-data |
This file contains 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
### EGYPTIAN SKULLS ANALYSIS | |
# libs -------------------------------------------------------------------- | |
library(pacman) | |
p_load(ggplot2, ade4, magrittr, reshape2, kirkegaard, plyr, psych) | |
# data -------------------------------------------------------------------- | |
#load | |
data(skulls) |
This file contains 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
### ANALYTIC REPLICATIONS OF NOAH CARL'S Explaining Terrorism Threat Level Across Western Countries | |
# libs -------------------------------------------------------------------- | |
library(pacman) | |
p_load(XLConnect, kirkegaard, psych, weights, magrittr, effsize, lsr, compute.es, MASS) | |
# data -------------------------------------------------------------------- |
OlderNewer