Site Loader

This week (Wed 29th Oct. 2019) will be the second of eight months of R Open Data Labs (one per month at the last Wednesday of each month).

Each of these labs will start with a very short (~15 minute) review of available R programming environments for those who are entirely new to R.

The next part of the session will be a brief sightseeing tour of a particular R package + technique, for those who are looking for a better understanding of what R can do (~ 0.5 hrs).

The sightseeing portion of the October 29th R lab will focus on R’s unique and efficient way of representing statistical models.

As the relevant wikipedia page says, a statistical model “is usually specified as a mathematical relationship between one or more random variables and other non-random variables. As such, a statistical model is ‘a formal representation of a theory.’ ”

R has a special ‘formula’ object (going back to S, the precursor to R) that provides a sort of short hand, or regular expression syntax for easily describing statistical models.

Some basics:

Some extra details:

  • This article has a more technical discussion of the formula object, in the context of a library built to extend this original object (class).

Some examples of using the formula object:

Last but not least: a bit on objects (or classes in R):

Post Author: Jen Schellinck

Jen Schellinck is the principal of Sysabee and an adjunct professor at Carleton's Institute of Cognitive Science. She founded Sysabee in 2012 with the goal of taking analysis techniques from machine learning and systems modeling and making these available to organizations who are seeking to gain the benefits of technology supported analysis and decision making. For each project, she draws from a pool of expert consultants to create a team customized to the specific needs of the project. She is also the founding member of the Data Science Experts Group, an association of data professionals that build flexible, customized solutions for data-driven companies and organizations. She remains an active participant in academic research via Carleton’s Cognitive Modeling Lab.