Controlling for confounders in penalized regression

Controlling for confounders in OLS When teaching introductory linear regression, one of my favorite topics is adjusted variable plots (also known as “added variable plots”). The basic idea is this: say you want to relate two sets of predictor variables, X and Z, to a single response variable y. One standard way to do this … Continue reading Controlling for confounders in penalized regression

Assigning independent components to canonical brain networks

A lot of the work my group does these days focuses on independent component analysis (ICA). ICA is a blind-source separation algorithm that is a popular way to analyze fMRI data. With ICA, you get a set of spatial independent component (IC) maps and a “mixing matrix” that contains the temporal activity associated with each … Continue reading Assigning independent components to canonical brain networks

Google Drive for Desktop across multiple mac users? No.

My lab uses a Mac Pro with 512GB RAM for most of our computationally intensive analyses. It’s been a great resource, giving us local control and immediate access to high-performance computing, while providing a familiar environment (Mac OS) where we can also test software that will be run by many Mac users. We also use … Continue reading Google Drive for Desktop across multiple mac users? No.

How to perform CompCor on HCP fMRI data in R

This is a guest post written by Damon Pham. Damon is a recent graduate from Indiana University, where he was a Wells Scholar (the highest honor for incoming IU students) and all around extraordinaire. He has been part of my research group for the last several years, where one of his main focuses has been … Continue reading How to perform CompCor on HCP fMRI data in R

The Role of Centering in Dual Regression

Dual regression is maybe the simplest way to obtain subject-specific estimates of ICA-based resting-state networks (RSNs).  RSNs are regions of the brain that tend to act in a coordinated manner in the absence of a specific task, such as the three shown below (from a 50-component ICA of the Human Connectome Project).  Popular ICA toolboxes for … Continue reading The Role of Centering in Dual Regression

How to efficiently prewhiten fMRI timeseries the “right” way

I recently got around to reading the high-profile PNAS paper titled “Cluster failure: Why fMRI inferences for spatial extent have inflated false-positive rates” (Eklund et al. 2016), which called attention to the importance of properly processing and analyzing fMRI data. This lead me to an earlier paper titled “Does parametric fMRI analysis with SPM yield valid … Continue reading How to efficiently prewhiten fMRI timeseries the “right” way

R function to write CIFTI files

Update: This post is outdated.  Use our ciftiTools R package instead!  ciftiTools is available to install from CRAN in R: install.packages(“ciftiTools”) or from GitHub for the latest release: library(devtools) install_github(‘mandymejia/ciftiTools’) For more information about ciftiTools, check out our paper in NeuroImage: Pham, D., Muschelli, J., & Mejia, A. (2022). ciftiTools: A package for reading, writing, … Continue reading R function to write CIFTI files

A layman’s guide to working with CIFTI files

Update 4/6/2022: Check out our ciftiTools R package, available via CRAN and Github! install.packages(“ciftiTools”) #install from CRAN library(devtools); install_github(“mandymejia/ciftiTools”) #install from GitHub We also have a paper about it out in NeuroImage: Pham, D., Muschelli, J., & Mejia, A. (2022). ciftiTools: A package for reading, writing, visualizing, and manipulating CIFTI files in R. NeuroImage, 118877. … Continue reading A layman’s guide to working with CIFTI files

Derivation and interpretation of leverage in SLR

I was recently looking online for an explicit derivation of leverage — the diagonals of the “hat matrix” — in simple linear regression. If X is the n-times-p matrix of explanatory variables in a linear model, then the hat matrix is H=X(X’X)-1X’, so called because it puts the “hat” on the predicted values, since Ŷ … Continue reading Derivation and interpretation of leverage in SLR

Tips for submitting to arXiv for the first time

Today I successfully submitted my first paper to arXiv!  We’ve submitted this paper to a journal, but it hasn’t been published yet, so we wanted to get a pre-print up before advertising the corresponding software packages.  Unfortunately, the process of submitting to arXiv wasn’t painless.  Now that I’ve figured out some of the quirks, however, hopefully your … Continue reading Tips for submitting to arXiv for the first time

Three ways to use MATLAB from R

Being a statistician working in neuroimaging is a little like living abroad and trying to speak a foreign language. For example, my first language is English, but I spent my first summer as a PhD student doing research at LMU in Munich, Germany. I had taken German in college and could have really basic conversations, … Continue reading Three ways to use MATLAB from R

Why I’m a Screen evangelist (and how to get started)

I’ve recently made several upgrades to my workflow that make me say “WHY OH WHY did it take me this long to start doing this?”  One of the big upgrades was using Sublime + Enhanced-R as explained by Alyssa Frazee to send code line-by-line to the Terminal with a simple keystroke.  Copy and paste no more!  It makes … Continue reading Why I’m a Screen evangelist (and how to get started)

What is quantitative MRI, and why does it matter?

This post is going to be a gentle introduction to MRI, which is a type of brain imaging and my current focus of research.  I’m planning a future post or two about my research, so I thought I’d provide a little background for people who don’t know much, if anything, about MRI.  I am by … Continue reading What is quantitative MRI, and why does it matter?

10 reasons to switch to ggplot

Making plots is a necessary and useful task for anyone who works with data. While making the standard plots is a pretty straightforward task in most statistical programming languagues, including R, when it comes to using R‘s base graphics to make custom plots (the plots you actually want to make) things can get complicated. As … Continue reading 10 reasons to switch to ggplot

Hello World

Welcome to my new blog!  To see some other great Hopkins biostat blogs, check out students Alyssa Frazee, Jean-Philippe Fortin, Leonardo Collado Torres, Elizabeth Sweeney, and John Muschelli, and of course the ultimate biostat blog, Simply Statistics. And stay tuned for the upcoming Bmore Biostats, a collection of Hopkins biostat student blogs!

Design a site like this with WordPress.com
Get started