Society for Industrial and Organizational Psychology > Research & Publications > TIP > TIP Back Issues > 2016 > July

masthead710

Volume 54     Number 1    July 2016      Editor: Tara Behrend

Jim Rebar
/ Categories: 541

An Introduction Plus a Crash Course in R

Richard Langers

The explosive growth of new workplace technology is fundamentally changing I-O psychology in both practice and academia.  Yet love of technology is not why most of us pursued a career in I-O psychology.  Modern I-O academicians and practitioners are both heavy users of technology, and we usually consider technology to be nothing more than a toolkit for (or perhaps an obstacle to) accomplishing our goals.  This means that changes in technology are, in many ways, things that happen to us.  Such changes challenge us by forcing us to take stock of our current skills and predict what new skills we’ll need in the future; sure, there are faster, better ways to accomplish things we’ve been doing for years, but will it be worth it to spend the time to switch?  They challenge us by opening up new possibilities, replacing old ways of thinking and working, adding truly unique capabilities we didn’t have before.  They challenge us by driving both our clients and our journal reviewers to their bright shiny colors, yet a technology’s newness doesn’t automatically mean it is better or even different from what we had before.  So what should we do?  How do we navigate this minefield of wasted time and effort mixed with true potential for improvement?  Welcome to A Crash Course in I-O Technology, my attempt to arm you with the knowledge of which technologies are worth learning while providing you with all the tools you need to go learn them.

So first things first: What do I mean by “technology”?1 This is a more contentious issue than you might realize.  Hansen and Forelich (1994) provided a detailed account of it and the many perspectives from which technology has been defined.  From the perspective of history, technologies are not just machines or software but also include rationales, procedures, and methods—in this sense, job analysis and assessment design are technologies.  From the perspective of sociology, technology is something that creates social factors changing how people and groups behave—in this sense, I-O psychology is itself a technology, driving I-O-related behaviors all over the world.  From the perspective of education, technology is unique discipline, with principles of study, knowledge, and skill relevant to its study, and both theorists and practitioners of it—and indeed, we see evidence of this in the existence of emerging fields of study like human resources information systems.  In contrast to all this, accounts from the perspective of I-O psychology are few, which I suspect is because most I-Os, as users and not scholars of technology, don’t give the issue much thought.  Even in Coovert and Thompson’s (2014) seminal text on the topic from an I-O perspective, Psychology of Workplace Technology, such definitions are few.

In one of the most highly cited articles of all time on the definition of technology in organizations, Orlikowski (1992) wrote in Organization Science that such conceptualizations range in both scope and role.  Scope ranges on a continuum from a highly specific “hardware” view in which specific machines or systems can be labeled “technologies” to an extraordinarily general “social” view that includes any “tasks, techniques and knowledge utilized when humans engage in any productive activities” (p. 399).  In contrast, she presented role as categorical with three types.  First, those following a technological imperative model frame technology as an objective construct that can be measured and used in prediction.  Second, those following a strategic choice model consider technology to be an unstable construct; technologies change constantly as the product of an ongoing interaction between human activities within the technology, the design choices that created the technology, and the degree to which the human–design interaction has been optimized.  Third, those following a structural change trigger model consider technology to itself be a key cause of change, where technology principally serves as the cause of larger-scale organization-level change.  Orlikowski herself then presented yet another model (as academics are wont) that she labelled a structurational model, proposing that technology is all of these things, that people and technology are in a reciprocal relationship affecting each other, that the developed technologies by people shape the organizational systems in which they are inserted, and that those organizational systems in turn affect people.  You can see it for yourself in Figure 1.  It’s a big cyclical mess, as real life processes tend to be.

Figure 1. Structurational model of technology, adapted from Orlikowski (1991).

I’m not going to attempt to solve such theoretical problems in this humble little column, but I am going to use it to frame what I’m trying to accomplish here.  Specifically, I contend that I-O psychologists have for too long sat on the receiving end of this structurational model, allowing technology to happen to us as other organizational stakeholders actually make impactful decisions about technology that fundamentally change a lot of what we do.  We allow our clients to drive our adoption of new technologies, only giving in when the ROI becomes irresistible.  We begrudgingly adopt new software only when it becomes obvious we cannot do without it.  Technology happens to us, and it’s time for that to change.  We need to become our own agents of technological change.  We need to understand technology well enough to help shape it for our purposes, whether this is to improve our own productivity or to provide our clients with the best services we can.  To that end, I’m writing Crash Course to provide you with both the broader context of one I-O-relevant technology each issue and also a practical, hands-on introductory tutorial to it, so that you can make an informed decision about whether or not that technology is something you personally want to pursue.  As you learn about specific technology, you will also increase your overall technological fluency, helping you make such decisions more broadly.  I’ll be covering a wide range of technologies varying in both scope and role but generally focusing on ones of immediate practical value to both academicians and practitioners.  I’ll also be conducting a variety of short interviews with I-Os about the focal technology, including their thoughts when relevant.  If you have your own suggestions for specific technologies to cover, just throw me an email (rnlanders@odu.edu) or tweet in my direction (@rnlanders).

A Crash Course in R

So, with less than half a column left, I’ve chosen our first Crash Course to be on some software likely familiar to you even if you haven’t used it personally: R. R is commonly touted by the more statistically fluent among us as the free replacement for and marked improvement upon the analytic software you most likely use now, SPSS.  R can do everything SPSS can do, but better; Isaac Thompson, recent I-O PhD from North Carolina State University, went so far as to say “at this point, learning SPSS may actually be a deficit.”  In their article provocatively titled “R is for Revolution,” Steven Culpepper and Herman Aguinis presented R as appropriate for students and graduates, for practitioners or academicians, for datasets large and small.  It is even taught in place of SPSS in a handful of graduate I-O programs already.  So why don’t more people use it?  The short answer is the learning curve.

The reason R is so difficult to learn for I-Os is because it is not actually statistical software—that is merely how it is most commonly used.  Instead, R is a programming language, although one designed by statisticians.  Its status as a programming language is an important one, because it fundamentally changes how you interact with it.  In SPSS, you essentially “order up” an analysis by getting your data in place and then clicking through a few menu options to create the results for which you’re looking.  In R, you send text commands one line at a time to the R interpreter, which executes your commands precisely as written and sends you the result.  These commands go far beyond statistical analysis.  For example, Jeff Jones, an I-O practitioner at Korn Ferry, put together “code that takes data, performs statistical analyses, creates figures, and prints a formatted PDF report.”  Jeff explained that the R interpreter is so flexible that it can be used in the cloud. When a client views a website, that website can run R in the background and deliver custom reports and output to the client’s web browser without any intervention from an I-O but based upon an I-O’s specifications.  That’s an enormous amount of power and flexibility.

Let’s See It in Action

So what does R actually look like?  Let’s look at an example of a line of R (see Figure 2), which runs the following R code:

exp_condition <- c('A','A','A','B','B','B','B','B')

exp_condition

Figure 2.  R running two lines of code.

In the first line, there’s a lot happening.  On the left, a variable’s name is given: exp_condition.  By default, variables are completely blank until you put something in them.  The “<-“ symbol, which is called the assignment operator, follows the variable name.  The assignment operator says “define whatever is on the left side of this operator with whatever is on the right side of this operator.” On the right side, a function is called, which has various arguments (sometimes called parameters).  Functions can be recognized because they are always followed by parentheses, in this case, c is a function.  The purpose of the c function (sometimes called the combine function) is to create a vector, which is just a list of data (numbers, letters, pictures, documents; there are many options). The only arguments passed to the c function are the data to be placed into the vector.  So to summarize this line, the c function places the eight letters contained in its arguments into a variable called exp_condition. Thus, a new variable with eight values is created, assuming it did not exist already.  The second line, which only consists of the name of exp_condition, tells R to print what the variable exp_condition currently contains.

So how do I know all of that?  The simple answer is that I know the R language.  A c is a particular bit of R vocabulary, and I know what arguments must be sent to c in order to make a complete sentence that means what I intended it to.  If you didn’t know what it meant already, you’d likely turn to online reference manuals.  More on that later.  But like any language, the more vocabulary and syntax you can use fluently, the easier and faster communicating with it becomes.  To see a more complete example of R in action, see the video accompanying this article.

Crash Course in I-O Technology: R from TNTLab on Vimeo.

So Who Should Learn R?

If you’ve ever been unable to conduct a particular needed analysis or create a custom figure, chart, or other visualization that you needed in SPSS, R is what you should turn to as a replacement.  If you’ve ever been annoyed copy/pasting a correlation matrix from SPSS output, R will solve your woes; as Adam Meade told me, “Three small lines of code to go from raw data to APA-publication ready format.”  If you want to expand into the “big data” arena, R is the tool of that trade.  If you can’t afford SPSS, R is free.  If you just want your figures to look more professional, R is the answer.  In short, learn R!  Just like when you learn a spoken language, you will find that learning a little of the R language will making learning more R much easier.  Once you have a working vocabulary and basic understanding of syntax, you will find your analytic and presentation horizons much expanded.

To Learn More

Here are a few steps to get started in R:

  1. First, try a quick, low-pressure online course in R, all within your web browser!  For that, I recommend http://tryr.codeschool.com
     
  2. If you find you enjoy feeling the power of R at your fingertips, download R onto your own system! You can find it here: http://cran.cnr.berkeley.edu/
     
  3. Because R is a programming language, you won’t find it alone terribly practical.  You need to also download a program to interface with it.  I recommend RStudio, which you can see in Figure 3 and can download here: http://rstudio.com

Figure 3. RStudio, showing syntax file (top-left), R console (bottom-right), current stored variables (top-right) and plots (bottom-right).

  1. Complete a more in-depth, free, online course in R.  Both Steven Tseng, an I-O grad student at the University of Akron, and Anish Thomas, an I-O practitioner at Altria, recommended the Johns Hopkins Coursera R course, which can be audited for free here: https://www.coursera.org/learn/r-programming.  If you prefer your training to be short and sweet, Scott Tonidandel, Steve Culpepper, and Jeff Stanton also regularly teach summer workshops on R: http://und.edu/carma/short-courses/detroit-short-course.cfm
     
  2. Try out your own projects! The best way to learn a programming language is to think of something you want to accomplish and try.  Once you hit a roadblock along that road, there are three options:
     
    1. If you’re having trouble with a specific function, consult the R documentation produced by the people that wrote those R functions you’re trying to use to see if you have its arguments correct.  This is done using the help()function in R.  For example, if you wanted to know more about the c function, you could use the command help(c).  This is also useful if you want to change what a function does slightly but are not sure how.
       
    2. If you want to do an analysis but aren’t sure which function to use, consult Culpepper and Aguinis’ (2011) article.  They provide the name of several functions commonly needed by I-Os.  There’s also a package called iopsychwith several I-O-specific functions (including the ability to create pareto-optimal plots!) written by Allen Goebl, Jeff Jones and Adam Beatty, which you can find here: https://cran.rstudio.com/web/packages/iopsych/index.html
       
    3. If you can’t figure out what function you need or how to read the documentation, the next step is to search for your question on social media.  Programmers are generally a social bunch, so you can often get help with your problems at the Cross Validated site on Stack Exchange: http://stats.stackexchange.com/.  Another popular part of Stack Exchange is Stack Overflow, where you can find or post questions tagged r: http://stackoverflow.com/questions/tagged/r.  Cross Validated questions tend to be more about statistical procedures whereas Stack Overflow questions tend to be more programming specific, but it varies quite a bit.
       
    4. If that doesn’t help, there’s one last resort: Google.  On the bright side, because R is such a popular program, you’re likely to find someone else that’s already solved your problem and posted the solution with enough searching.
       
  3. Once you’ve got a handle on the basics, learn how to make R more efficient and enjoyable to use.  Jeromy Anglim, an I-O and R evangelist, suggests learning about knitr, RMarkdown, and ProjectTemplate.

Conclusion

That’s it for the first edition of Crash Course!  If you have any questions, suggestions, or recommendations about R or Crash Course, I’d love to hear from you (rnlanders@odu.edu; @rnlanders).

Notes

1 If you find my obsession with definitions a bit odd, you can blame John P. Campbell, who taught me that any paper written without defining the constructs it explores is not a paper worth reading.

References

Coovert, M. D., & Thompson, L. F. (2014). Psychology of workplace technology.  Routledge: New York, NY.

Culpepper, S. A. & Aguinis, H. (2011). R is for revolution: A cutting-edge, free, open source statistical package. Organizational Research Methods, 14, 735–740.

Hansen, R. & Froelich, M. (1994). Defining technology and technological education: A crisis, or cause for celebration? International Journal of Technology and Design Education, 4, 179–207.

Orlikowski, W. J. (1992). The duality of technology: Rethinking the concept of technology in organizations. Organization Science, 3, 398–427.

Previous Article President's Message: Reflections on the Conference
Next Article On Being Halfway to Tenure (and Wondering How on Earth That Happened)
Print
3756 Rate this article:
3.0