Skip to content

Instantly share code, notes, and snippets.

View chris-prener's full-sized avatar

Chris Prener chris-prener

View GitHub Profile
@chris-prener
chris-prener / asrBibTeX.tex
Last active February 19, 2024 17:27
Setting up a LaTeX document with a custom style for the American Sociological Review
%% ASR Formatted Bibliography using BibTeX
%% requires the American Sociological Review .bst file - http://people.ku.edu/~chkim/etc/asr.bst
%% requires a properly formatted .bib file
%% requires that the key inserted below matches a key in that .bib file
\documentclass{book}
\usepackage{chicago}
\begin{document}
@chris-prener
chris-prener / asrBibTeX-Tufte.tex
Last active October 23, 2016 12:21
Setting up a Tufte-style LaTeX document with a custom style for the American Sociological Review
%% ASR Formatted Bibliography using BibTeX and the Tufte document style
%% requires the American Sociological Review .bst file - http://people.ku.edu/~chkim/etc/asr.bst
%% requires a properly formatted .bib file
%% requires that the key inserted below matches a key in that .bib file
\documentclass[nobib]{tufte-handout}
\usepackage{chicago}
\begin{document}
@chris-prener
chris-prener / oneSamplePlot.do
Last active February 4, 2020 22:05
Example of Stata plot for a one sample t-test
// ==========================================================================
// Minimal Working Example - One Sample T-Test Plot
// ==========================================================================
// standard opening options
version 14
log close _all
@chris-prener
chris-prener / twoSamplePlot.do
Created October 24, 2016 04:20
Example of Stata plot for a independent sample t-test
// ==========================================================================
// Minimal Working Example - Independent Sample T-Test Plot
// ==========================================================================
// standard opening options
version 14
log close _all
@chris-prener
chris-prener / dependentSamplePlot.do
Created October 24, 2016 04:24
Example of Stata plot for a dependent sample t-test
// ==========================================================================
// Minimal Working Example - Dependent Sample T-Test Plot
// ==========================================================================
// standard opening options
version 14
log close _all
@chris-prener
chris-prener / week-08-binary.R
Last active October 17, 2017 19:07
SOC 4930 & SOC 5050 - Week 08 - Binary Variable for Examples
library(tidyverse)
mpg %>%
mutate(foreign = ifelse(manufacturer == "audi" |
manufacturer == "honda" |
manufacturer == "hyundai" |
manufacturer == "land rover" |
manufacturer == "nissan" |
manufacturer == "subaru" |
manufacturer == "toyota" |
@chris-prener
chris-prener / week-08-tips.R
Last active October 18, 2017 14:52
SOC 4930 & SOC 505 - Week 08 - Tips for Paired Data
# reprex of issues related to working with paired data
## dependencies
library(stlData)
library(dplyr)
library(ggplot2)
library(tidyr)
## data preparation
income <- stlIncome
@chris-prener
chris-prener / week-11-correlationTable.R
Last active November 2, 2017 11:40
SOC 4930 & SOC 5050 - Week 11 - Producing Correlation Tables in R
# Correlation Table Output
# Function for producing corrleation table output with statistical significance symbols
# Dependencies:
# the following packages must be installed within R - dplyr, Hmsic, rlang
# Parameters:
# .data - A tbl
# coef - Type of correlation coefficient to be calculated (Pearson's r or Spearman's rho)
@chris-prener
chris-prener / week-11-correlationOutput.R
Created November 6, 2017 16:19
SOC 4930 & SOC 5050 - Week 11 - Producing Correlation Output in R
library(ggplot2)
library(stargazer)
# load data
autoData <- mpg
# create correlation table
# requires that the corrTable function is available in your global environment
output <- corrTable(autoData, coef = "pearson", listwise = TRUE, round = 3, pStar = TRUE, cyl, cty, hwy)
@chris-prener
chris-prener / week-12-lecture.Rmd
Created November 13, 2017 21:24
SOC 4930 & SOC 5050 - Week 12 - Plot and Linear Model Examples
---
title: "Week-12 Lecture"
output: html_notebook
---
## Introduction
This is the sample code for Week 12's lecture.
## Dependencies