Skip to content

Instantly share code, notes, and snippets.

View drammock's full-sized avatar

Daniel McCloy drammock

View GitHub Profile
"""Hotelling T2 example.
Following the notation in
https://en.wikipedia.org/wiki/Hotelling%27s_T-squared_distribution#Two-sample_statistic
"""
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@JoshCheek
JoshCheek / why_i_chose_fish_over_bash_for_students.md
Last active December 14, 2021 20:30
Why I Chose Fish Over Bash For Students

Why I chose Fish over Bash for students

I'm currently the lead instructor at Code Platoon and an instructor/developer at the Turing School of Software and Design.

I've been advocating the Fish shell and when the choice is up to me, I choose that for my students. Enough people ask about the decision, particularly in relation to the preinstalled Bash shell, that I figured it's worth laying out my reasoning.

TL;DR

@tmalsburg
tmalsburg / predict_vs_simulate.org
Last active November 18, 2022 01:14
Predict vs simulate in lme4

Predict vs simulate in lme4

For this investigation we are going to use the sleepdata data set from the lme4 package. Here is the head of the data frame:

@lmullen
lmullen / Makefile
Last active May 30, 2024 09:34
PDF slides and handouts using Pandoc and Beamer
SLIDES := $(patsubst %.md,%.md.slides.pdf,$(wildcard *.md))
HANDOUTS := $(patsubst %.md,%.md.handout.pdf,$(wildcard *.md))
all : $(SLIDES) $(HANDOUTS)
%.md.slides.pdf : %.md
pandoc $^ -t beamer --slide-level 2 -o $@
%.md.handout.pdf : %.md
pandoc $^ -t beamer --slide-level 2 -V handout -o $@
@casallas
casallas / ng_lmm.md
Last active January 4, 2016 02:59
(non | generalized) linear mixed-effects models (or multi-level [non | generalized] linear models), and ANOVA
@even4void
even4void / raneff.r
Last active June 1, 2017 04:30
Illustration of within-unit vs. random-effect model predictions.
library(lme4)
data(sleepstudy)
## Fit individual regression lines for each subject
dfrm <- coef(lmList(Reaction ~ Days | Subject, sleepstudy))
## Estimate parameters of a random intercept and random intercept and slope model
m1 <- lmer(Reaction ~ Days + (1 | Subject), data=sleepstudy)
m2 <- lmer(Reaction ~ Days + (Days | Subject), data=sleepstudy)
@mastbaum
mastbaum / custom_directive.py
Created May 10, 2012 20:32
Example of a custom ReST directive in Python docutils
'''Example of a custom ReST directive in Python docutils'''
import docutils.core
from docutils.nodes import TextElement, Inline
from docutils.parsers.rst import Directive, directives
from docutils.writers.html4css1 import Writer, HTMLTranslator
class foo(Inline, TextElement):
'''This node class is a no-op -- just a fun way to define some parameters.
There are lots of base classes to choose from in `docutils.nodes`.
@avram
avram / csv2zotero.py
Created July 16, 2011 11:16
Script to batch-add items defined in a CSV file to Zotero
#!/usr/bin/python
# -*- coding: utf8 -*-
# We'll use the pyzotero project for server access
# See packages.python.org/Pyzotero/
from pyzotero import zotero
import sys
# Python's built-in CSV support is pretty nice