Steve's Miscellaneous Functions
Compare Linear Smoother to LOESS Smoother for Your OLS Model
Scoped Helper Verbs
Generate a Binned-Residual Plot from a Fitted Generalized Linear Model
Recode a Variable
Simulate Data from Correlation Matrix
Create multivariate data by permutation
Lazily select variables from multiple tables in a relational database
Reorganize a factor after "re-leveling" it
Filter a Data Frame of Citations and Return the Entries as a Character
Get Simulations from a Model Object (with New Data)
Get a small data frame of the variable label and values.
Legacy functions for Steve's Preferred ggplot2
Themes and Assorted S...
Set the Only Reproducible Seed That Matters
Make Percentage Label for Proportion and Add Percentage Sign
Rescale Vector to Arbitrary Minimum and Maximum
Multiply a Number by 100 and Round It (By Default: 2)
Find Non-Matching Elements
Make and annotate a normal distribution with ggplot2
Convert the p-value you want to the z-value it actually is
Prepare bib2df
Data Frame for Formatting to Various Outputs
Print and Format .bib
Entries as References
Create "peace years" or "spells" by cross-sectional unit, more general...
Create "spells" by cross-sectional unit, even more generally
Scale a vector by one standard deviation
Scale a vector (or vectors) by two standard deviations
Bounded Normal (Really: Scaled Beta) Distribution
Residual Density Plot for Linear Models
Reverse code a numeric variable
Bootstrap a Regression Model, the Bayesian Way
Create "peace years" or "spells" by cross-sectional unit
Get a caterpillar plot of random effects from a mixed model
Simulate from a Multivariate Normal Distribution
The Student-t Distribution (Location-Scale)
Convert data frame to an object of class "tibble"
Get Weighted Least Squares of Your OLS Model
Generate Week of the Month from a Date
These are miscellaneous functions that I find useful for my research and teaching. The contents include themes for plots, functions for simulating quantities of interest from regression models, functions for simulating various forms of fake data for instructional/research purposes, and many more. All told, the functions provided here are broadly useful for data organization, data presentation, data recoding, and data simulation.