Publications by strictlystat
Sorted HTML Tables and Javascript Libraries
A few days ago StatsInTheWild asked the following question In the R function “sortable.html.table”, it's sorting 9.2 higher than 30.5 because of the leading digit. How do I fix this? — SITW (@StatsInTheWild) July 23, 2014 So we had a few exchanges where I thought you could use sprintf and be done but it didn't seem to work: @StrictlyStat It...
2809 sym R (1051 sym/3 pcs) 4 img
Working with NIfTI images in R
The oro.nifti package is awesome for NeuRoimaging (couldn't help myself). It has functions to read/write images, introduces the S4 nifti class, and has useful plotting functions. There are some limitations and some gotchas that are important to discuss if you are working with these objects in R. Dataset Creation We'll read in some data (a tem...
7040 sym R (4774 sym/21 pcs) 10 img
My Commonly Done ggplot2 graphs
In my last post, I discussed how ggplot2 is not always the answer to the question “How should I plot this” and that base graphics were still very useful. Why Do I use ggplot2 then? The overall question still remains: why (do I) use ggplot2? ggplot2 vs lattice For one, ggplot2 replaced the lattice package for many plot types for me. The latti...
8267 sym R (2832 sym/26 pcs) 46 img
My Commonly Done ggplot2 graphs: Part 2
In my last post I described some of my commonly done ggplot2 graphs. It seems as though some people are interested in these, so I was going to follow this up with other plots I make frequently. Scatterplot colored by continuous variable The setup of the data for the scatterplots will be the same as the previous post, one x variable and one y var...
6127 sym R (2952 sym/23 pcs) 46 img
A small introduction to the ROCR package
I've been doing some classification with logistic regression in brain imaging recently. I have been using the ROCR package, which is helpful at estimating performance measures and plotting these measures over a range of cutoffs. The prediction and performance functions are the workhorses of most of the analyses in ROCR I've been doing. For tho...
9153 sym R (5642 sym/21 pcs) 12 img
Adding Cost Functions to ROCR performance objects
In my last post, I gave an introduction of the ROCR package and how to use it for ROC analysis. In the ROCR reference manual, it states “new performance measures can be added using a standard interface”, but I have not found that to be so. I may have missed some crucial step, but others have tried to adapt new performance measures. One exam...
5626 sym R (9522 sym/10 pcs) 16 img 1 tbl
The average Stripe employee! Congrats to Alyssa!
Recently, my colleague and fellow blogger Alyssa Frazee accepted a job at Stripe. All of us at JHU Biostat are happy for her, yet sad to see her go. While perusing Stripe’s website, I found the About page, where each employee has a photo of themselves. I’ve been playing around with some PCA and decompositions, so I figured I’d play around w...
5150 sym R (2433 sym/12 pcs) 14 img
Using Tables for Statistics on Large Vectors
This is the first post I’ve written in a while. I have been somewhat radio silent on social media, but I’m jumping back in. Now, I work with brain images, which can have millions of elements (referred to as voxels). Many of these elements are zero (for background). We want to calculate basic statistics on the data usually and I wanted to...
5281 sym R (3695 sym/12 pcs) 10 img
The Unofficial ENAR 2015 Itinerary Maker
It’s almost ENAR 2015! The final program is out with all the sessions. The last conference I went to, the International Stroke Conference, had a program planner hosted by abstracts online. Although there are parts of this system I would like to change, I believe it is helpful for looking up sessions, presenters, and especially posters. The...
3151 sym 6 img
White Matter Segmentation in R
Goals and Overall Approach We will use multiple packages and pieces of software for white matter (and gray matter/cerebro spinal fluid (CSF)) segmentation. The overall approach will be, with the required packages in parentheses: N4 Inhomogeneity Bias-Field Correction (extrantsr and ANTsR) Brain extraction using BET and additional tools (extrant...
4436 sym R (1969 sym/12 pcs) 14 img