Skip to content

Instantly share code, notes, and snippets.

View smasongarrison's full-sized avatar
😸
Tenure-Tracking

Mason Garrison smasongarrison

😸
Tenure-Tracking
View GitHub Profile
@smasongarrison
smasongarrison / bivariate_normal_wallpaper.r
Created June 1, 2017 20:10 — forked from wviechtb/bivariate_normal_wallpaper.r
Code to generate wallpaper (bivariate normal distribution)
library(mvtnorm)
### correlation for the bivariate normal distribution
rho <- 0.4
### number of points for x and y at which to evaluate the density of the bivariate normal distribution
n <- 501
sigma <- matrix(c(1,rho,rho,1), nrow=2)
\documentclass{beamer}
\usetheme{Singapore}
\usepackage{tipa}
%% Make the r-code small
\ifdefined\knitrout
\renewenvironment{knitrout}{\begin{footnotesize}}{\end{footnotesize}}
\else
\fi
##
## Example code for time-to-event analysis in R
## matt@baggott.net
## Dec 28, 2012
##
## joineR package: analyzing longitudinal data where the response
## from each person is a time-sequence of repeated measurements
## and we are interested in a possibly censored time-to-event outcome
##
## example: repeated ad viewings leading to a sale
#
# Functions to make ggplot KM survivor curves made with survfit() in library(survival)
#
# code written by Ramon Saccilotto
# and included in his ggplot2 tutorial
# 2010-12-08
# define custom function to create a survival data.frame
createSurvivalFrame <- function(f.survfit){
# initialise frame variable