Skip to content

Code that might be useful to others for learning/demonstration purposes.

Notifications You must be signed in to change notification settings

sbansiheng/Miscellaneous-R-Code

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Miscellaneous (mostly) R Code

This is a place for miscellaneous R and other code I've put together for clients, co-workers or myself for learning and demonstration purposes. The attempt is made to put together some well-commented and/or conceptually clear code from scratch, though most functionality is readily available in any number of well-developed R packages. Typically examples are provided using such packages for comparison of results.

At present I'm now doing these via markdown, so any demo code will typically have an md, Rmd, and html file rather than, or in addition to a (purled) R file. For a quick peek that shows most things in the way intended, one can look at the md file directly within github. Otherwise, one can view the html files here.

Model Fitting

Code related to fitting of various models.

standard regression, penalized regression, gradient descent regression (online), one factor random effects (R) (Julia) (Matlab), two factor random effects (R) (Julia) (Matlab), cubic spline, hurdle poisson, hurdle negbin, zero-inflated poisson, zero-inflated negbin, Cox survival, confirmatory factor analysis, EM mixture univariate, EM mixture multivariate, EM probit, EM pca, EM probabilistic pca, EM state space model, Gaussian Process noisy, Gaussian Process noise-free, reproducing kernel hilbert space regression, stochastic volatility, bivariate probit, quantile regression ...

Bayesian (mostly with Stan/rstan)

BEST t-test, linear regression (Compare with BUGS version, JAGS), mixed model, mixed model with correlated random effects, beta regression, mixed model with beta response (Stan) (JAGS), mixture model, topic model, multilevel mediation, variational bayes regression, gaussian process, ...

SC and TR

Short courses and technical reports I put together from time to time. This is currently changing from linking to the relevant code to linking to the docs themselves. The docs are or will be (after updating) made for web presentation first, but some will link to pdf.

Introduction to R, Generalized Additive Models, Machine Learning, Mixed Models, generally speaking (files)(pdf), Comparison of mixed models and 'ANOVA' (files) (pdf), Comparison of mixed and additive models (files) (pdf), Comparison of mixed and latent growth curve models (files), ...

Other

Random shenanigans.

FizzBuzz test (R) (julia) (Python), Reverse a string recursively (R) (Python), Recursive Word Wrap (R) (Python), get US Congress roll call data, Scrape xkcd (R) (Python), Shakespearean Insulter, ggplot2 theme, R matrix speedups, ...

About

Code that might be useful to others for learning/demonstration purposes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • R 77.3%
  • Stan 16.3%
  • Python 2.4%
  • Julia 1.6%
  • MATLAB 1.4%
  • Rebol 0.8%
  • CSS 0.2%