Publications by Jay Lasker
Minimum Detectable Difference in Pearson's r Between Subgroups in a Meta-Analysis
Setup library(metapower) Rationale I recently put up another RPubs post (https://rpubs.com/JLLJ/P2020H2) and someone asked me how I derived a few numbers. This function is how. Function This function wraps the function subgroup_power() from the metapower package. The estimand for subgroup_power() is the amount of power to detect a subgroup diff...
3733 sym R (3852 sym/8 pcs)
Are Rapid Antigen Tests a Coin Flip?
Some people think of Rapid Antigen Tests (RATs) as a coin flip and question their value. This is based on a misunderstanding of Bayes’ rule. If we think of the PPA and NPA as the sensitivity and specificity of the tests, we can arrive at the posterior given any prior as a function of the false-negative rate. With a coin toss, the probability of...
2185 sym R (277 sym/4 pcs)
Power and Effect Size Exaggeration
library(pacman); p_load(pwr, tidyr, dplyr, ggplot2, faux, boot) CRITR <- function(n, alpha = .05) { df <- n - 2; CRITT <- qt(alpha/2, df, lower.tail = F) CRITR <- sqrt((CRITT^2)/((CRITT^2) + df )) return(CRITR)} MeanSigR <- function(N, P = 0.05, R, Reps, seed = 1){ library(pacman); p_load(faux, boot) set.seed(seed) RepList <...
1260 sym R (16991 sym/11 pcs) 4 img
Power, Effects, and Robustness of Pesta et al. (2020)
Setup # Packages library(pacman); p_load(meta, metapower, metafor, sjmisc, DT) #Recoded Race Variables data$RaceRec <- rec(data$Race, rec = "White = White; Black = Black; Hispanic = Hispanic; Asian/Other, Multi-racial, Non-White = Other") #The maximum SE, as a robustness check data$HighSE <- rep(max(data$SESA), 42) # Data datatabl...
14509 sym R (54422 sym/130 pcs)
t Tests and ANOVAs with Summary Statistics
Functions and Rationale To assess some papers I’ve been looking at, I had to make functions for t-tests and ANOVAs from summary statistics. I found the t-test one on statexchange. library(pacman); p_load(rpsychi, lavaan, pwr) sum.t.test <- function(m1, m2, s1, s2, n1, n2, m0 = 0, equal.variance = F){ if(equal.variance == F){ se ...
6557 sym R (19234 sym/249 pcs) 1 img
Assortative Mating and the Polygenic Prediction of IQ
Setup library(pacman); p_load(ggplot2, DT, meta, metafor, dmetar, DescTools, tools, metasens) Rationale The predictive validity of polygenic scores within the general population is reduced within families for a multitude of reasons. One of these reasons is assortative mating. Assortative mating strikes against within-family prediction because it...
10954 sym R (52607 sym/42 pcs) 7 img
The Domain Specificity of Working Memory is Unknown
Setup ZREG <- function(B1, B2, SEB1, SEB2) { Z = (B1-B2)/sqrt((SEB1)^2 + (SEB2)^2) return(Z)} Rationale Kovacs, Molenaar & Conway (2019) claimed to find theoretical support for Process Overlap Theory in the form of differential differentiation of working memory capacity and short-term memory capacity by Gf, Gc, and Gv, as they suggested...
5651 sym R (2143 sym/33 pcs)
What Happens if you Copy Nancy Pelosi?
Setup library(pacman) p_load(BatchGetSymbols, dplyr, ggplot2, tidyr, lubridate, tsibble) What would happen if you bought and held the trades Nancy Pelosi was legally required to declare? Despite having a month lag, the answer indicates Nancy is an exceptionally gifted trader. Analysis df = read.csv("https://house-stock-watcher-data.s3-us-west...
229 sym R (5255 sym/6 pcs) 1 img
Classical Reliability Correction for Cohen's d and the Point-Biserial
A Method! Cohen’s d can be converted to a point-biserial correlation if both groups’ sample sizes and the value of Cohen’s d are known. This require two quantities in addition to d, m and h. \(m = n_1 + n_2 - 2\) and \(h = m/n_1 + m/n_2\). The point-biserial is just \[\frac{d \sqrt{d^2 + h}}{d^2+h}\] And converting back is a matter of...
760 sym R (1855 sym/18 pcs)
Measurement in Bates & Gignac (2022)
Setup library(pacman); p_load(psych, lavaan, sjmisc) CONGO <- function(F1, F2) { PHI = sum(F1*F2) / sqrt(sum(F1^2)*sum(F2^2)) return(PHI)} CRITR <- function(n, alpha = .05) { df <- n - 2; CRITT <- qt(alpha/2, df, lower.tail = F) CRITR <- sqrt((CRITT^2)/((CRITT^2) + df )) return(CRITR)} ZREG <- function(B1, B2, SEB1, SEB2) { ...
4411 sym R (50651 sym/153 pcs)