Models by Example

regression machine learning

Roll your own to understand more.

Michael Clark

New Book

I’ve completed a new bookdown document, Models by Example, that converts most of the code from my Miscellaneous R repo. I initially just wanted to update the code, but decided to use a more formal approach to make it cleaner and more accessible. It’s mostly complete, though may be added to on rare occasion, and further cleaned as I find annoying bits here and there. Each topic contains ‘by-hand’ demonstration, such that you can see conceptually how a model is estimated, or technique employed. This can help those that want to dive a little deeper to get a peek behind the curtain of the functions and packages they use, hopefully empowering them to go further with such models.

Topics covered include the following, and I plan to post a sample chapter soon.



If you see mistakes or want to suggest changes, please create an issue on the source repository.


Text and figures are licensed under Creative Commons Attribution CC BY-SA 4.0. Source code is available at, unless otherwise noted. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".


For attribution, please cite this work as

Clark (2020, Nov. 30). Michael Clark: Models by Example. Retrieved from

BibTeX citation

  author = {Clark, Michael},
  title = {Michael Clark: Models by Example},
  url = {},
  year = {2020}