Tuesday, April 23, 2013

Concerto v4.b web-based Content Management System for R Users

Concerto is a open source R Content Management System for developing online applications.  The primary purpose of Concerto is for the designing of online tests.  However, the hard working programmers at the University of Cambridge Psychometrics Centre have created a program that is flexible enough to address a wide range of applications such as the development of statistical learning tools, client management systems, as well as large scale survey deployment.  Future plans for Concerto would include the integration of it and the Psychometric's Center's facebook App which has collected detailed information for millions of respondents spanning a number of fascinating surveys.

The real beauty of Concerto is that it provides an interface that builds on the vast resources of R in order to seamlessly integrate a powerful environment capable of managing the enormous contributions of web developers.

Well, enough advertising.  Let's see how v4b works.

In this post I will map out the logic of Concerto environment as I understand it now.  I will flesh out more in future posts as I get a better grasp of the Concerto environment.

For this post and all future posts I will look only at version 4b of Concerto or higher.

For the test developer the base operating system is R.  For now I will use pseudo R-like code.  Pseudo code is useful at explaining coding concepts.

First we start with an initialization of a “test”.  Tests are made up of R code.

# START – pseudo code random item survey
# The first thing a test might do is have a user input demographic information.
1.> intro = Concerto.html.tempate(Introduction)

# The responses from the Introduction page are returned as a list assigned to the Intro object.
# This responses might include any kind of information like: age, name, gender, ect.  We can target the values the same way as any list object.
2> print(intro$age)

# Interestingly this command does not actually do anything as far as the user is concerned because the screen output from R is suppressed.  However in debugging mode screen returns from R are displayed in the testing window.
# We may write the information we have gathered so far to our user information table which is a sql table. Concerto R is able to send commands to sql.  Remember this is only pseudo-code.
3> Concerto.sql.send(user_table, user_name=intro$user.name, user_age=intro$user.age)

# Now let’s administer our test items.  Let’s say we have all of our items in a table.
4> items = concerto.sql.get(items)

# We can figure out how many we are by counting the rows.
5> nitems = nrows(items)

# We want to select 20 items randomly so that almost nobody shares item sets.
6> item.choice = sample(1:nitems, 20)

# Now to administer the items we simply send them to the user by looping through all of them.
7> response.vector = NULL
8> for (i in item.choice) response=c(response, Concerto.html.tempate(item.admin, params=list(text=items$text[i]))

# Now we have two vectors.  A vector of item responses and a vector of items administered.
# All that is left is to save this response pattern
9> Concerto.sql.send(response_table, items=item.choice, responses=response.vector)

# And provide the user with some feedback
10> feedback = feedback.analysis(item.choice, response.vector)

# Now we simply display the results of this feeback analysis (this of course would be a function that we have already coded.
11> concerto.html.template(Feedback)

# END – pseudo code random item survey

In future posts I will strive to post functioning code and functioning tests.  To learn more about Concerto check out the development website:


  1. I'm interested in the idea of a CMS for R users, but I'm a little confused about how this post is about that. I usually think of a content management system as something like Drupal or Wordpress. This tool seems like a very specific tool for doing surveys, right? Also, where is R used in Concerto?

    1. I can see how it seems that way. However, Concerto is a system that is similar to Drupal or Wordpress though admittedly so far less refined. I believe Concerto will eventually have all of the power of Drupal or Wordpress in time. The R code is the basis for the CMS. It runs and controls everything.

  2. Dear Francis,

    I asked you before about the runing of VAR, I have a question now about the impulse response functions. After runing a var model and finding some coefficent not statistically significant, could I interpret their IRF?
    Could I replace the IRF by the OIRF to have better result?

    Thank you very much

    1. Could you please email me. I am really not sure at all what you are meaning by VAR, IRF, or OIRF. Usually it is hard enough communicating the full names of methods between research groups let alone the abbreviated names. Either way, as an unrelated comment on an unrelated post is not an ideal place to ask such questions.

  3. This comment has been removed by a blog administrator.