Publications by Jay Lasker
IQ and Motivation via Duckworth et al. (2011)
Setup Packages library(pacman) p_load(dplyr, DT, meta, ggplot2, dmetar) Data #As the authors coded it in their supporting information with the Breuning studies removed. dc <- read.csv("DuckworthSupportCode.csv") #dc2 <- subset(dc, Hedge.s.g < 2) #If you want to remove Weiss (1980) datatable(dc, extensions = c("Buttons"), options = list(do...
14420 sym R (11478 sym/22 pcs) 4 img 1 tbl
Dataframe from Many .csvs
Code A friend sends me a .zip with folders for different rats containing .csvs with their values for something and he wants the values in each .csv for each different rat, day of the experiment, method, slice, and region of interest. Unfortunately he also wants this done in R. Code follows. library(data.table) files <- list.files(pattern = ".csv...
305 sym R (468 sym/1 pcs)
NFL Wonderlic Scores
Setup Packages library(pacman) p_load(DT, psych, ggplot2, dplyr) Data D <- read.csv("NFLWonderlic.csv") datatable(D, extensions = c("Buttons"), options = list(dom = 'Bfrtip', buttons = c('copy', 'csv', 'print'), scrollX = T)) describeBy(D, group = "Race") ## ## Descriptive statistics by group ## group: ## vars n mean sd m...
2660 sym R (12285 sym/30 pcs) 10 img
From Heritability to Probability
Setup Functions MPH2 <- function(p, h = 0.8){ MPH <- function(g){1/sqrt(2*pi*h*(1-h))*exp(-(g-(h*p))^2/(2*h*(1-h)))} if(p>=0){ FU <- integrate(MPH, lower = p/2, upper = Inf)} else{ FU <- integrate(MPH, lower = -Inf, upper = p/2)} return(FU$value)} NH2 <- function(h){ iFUN <- function(g, p){exp(-(g-(h*p))^2/(2*h*(1-h)))} iINT...
5979 sym R (2986 sym/18 pcs) 2 img
Northeast Asian Adult IQ Estimates
Setup Packages library(pacman) p_load(DT, metafor, metaviz, jtools, ggplot2, knitr, meta, dmetar) Data AM <- read.csv("AsianIQs.csv") datatable(AM, extensions = c("Buttons", "FixedColumns"), options = list(dom = 'Bfrtip', buttons = c('copy', 'csv', 'print'), scrollX = T, fixedColumns = list(leftColumns = 3))) Rationale The average IQs of nor...
8807 sym R (10561 sym/24 pcs) 7 img 1 tbl
The BAFACALO Battery
Setup Packages and Functions library(pacman) p_load(lavaan, psych, semPlot, VIM, egg, dplyr, knitr, ggplot2, reshape2, latex2exp) CONGO <- function(F1, F2) { PHI = sum(F1*F2) / sqrt(sum(F1^2)*sum(F2^2)) return(PHI)} Data BAF <- read.csv("BAFA.csv") Imputation ach_vars <- c("Portuguese", "English", "Geography", "History", "Biology", "P...
21196 sym R (41645 sym/109 pcs) 17 img 7 tbl
Dimensional Assessment of Cognitive Batteries
Setup Packages library(pacman) p_load(rootSolve, nlshrink, Matrix, dplyr, psych, ggplot2, EGAnet, lavaan, egg, qpcR, semPlot) Functions #Automatic Kaiser-Guttman Test KGA <- function(x){ SL = x$e.values which.min(SL >= 1) - 1} #Automatic Warne & Larsen (2014) Kaiser-Guttman revision MAPA <- function(x, a = 0.05, s = 2, d = 3){ L...
51919 sym R (109553 sym/409 pcs) 52 img 1 tbl
Are Executive Function and Intelligence Separate?
Setup Packages library(pacman) p_load(lavaan, psych, semPlot, tidySEM) Data #Correlation matrices #SST has been reflected to achieve all-positive loadings lowerFRE = ' 1 0.3 1 0.44 0.33 1 0.21 0.35 0.27 1 ...
31887 sym R (25251 sym/64 pcs) 8 img
Armspan and Winning Fights?
Setup Packages library(pacman) p_load(MASS, mice, psych, HH, ggplot2, readr, dplyr, magrittr, visreg, broom, purrr, tidyr, kirkegaard, DT, scales, purrr, ggpubr, jtools, huxtable, broom.mixed) Data Data retrieved from http://supp.apa.org/psycarticles/supplemental/ebs0000219/ebs0000219_supp.html. AL <- read.csv("MMA_data_sexed_checked.csv") For...
11364 sym R (8255 sym/53 pcs) 2 img 5 tbl
The Partialing Fallacy
Setup Packages library(pacman) p_load(dagitty, ggdag, jtools, huxtable, kirkegaard, corrplot) Rationale The whole point of multiple regression… is to try to isolate the effects of the individual regressors by ‘controlling’ on the others. Still, when orthogonality is absent the concept of the contribution of an individual regressor remai...
8901 sym R (2129 sym/6 pcs) 4 img 2 tbl