Can you quickly explain what ‘R Shiny’ is and how it works?
R is a free and open source statistical software that offers a complete, powerful and unified framework for all the dimensions of data science: data collection, management and visualization, regression and machine learning, and even report or beamer editing. It has been progressively adopted by the scientific community and is now increasingly used for business applications.
Concretely, it becomes possible to collect, visualize and model data from any internet browser
Shiny is a complementary package of R that allows development of web apps for data science with R. That is, the R software and all statistical analyses run on a server, while the user interacts with the software through a browser. Concretely, it becomes possible to collect, visualize and model data from any internet browser. No installation of R and R packages, nor programming knowledge, is required for the user of the app.
With Shiny, we enjoy only the most exciting part of data science: see and understand the patterns uncovered from the data, leaving the technical part to be handled by the server through R.
Therefore, Shiny offers interactive environments to:
- visualize raw data and results of data analysis
- let users run their own data analysis or visualization
- collect data from the users
What is the added value for your students?
Emmanuel Kemel: A typical difficulty when teaching data science is that the presentation of statistical techniques necessarily involves mathematical formulas. This can be scary for students who do not have a strong mathematical background.
Shiny allows me to complete the presentation of formulas simply, which helps students to better visualize and understand the meaning of the formula for data analysis.
- Understanding OLS
- Multi-collinearity versus omitted variable bias
Another difficulty is that the formal presentation of the techniques must be completed by practice in order to understand the advantages and limitations of each technique. Students must learn both how a given technique works and how to apply it.
These two aspects are necessary: knowing the logic of statistical techniques without begin able to apply them on concrete cases is useless; applying techniques without understanding their logic and limitations is dangerous as it can lead to false results and conclusions.
Practice on real data sets can take a lot of time, as students need to learn a specific statistical software. Sometimes the procedure for producing a data analysis is so complicated that students pay more attention to the procedure itself than to the results!
I developed a Shiny app where students can apply the concepts of my course on any data set without having to install or learn any statistical software
I developed a Shiny app where students can apply the concepts of my course on any data set without having to install or learn any statistical software. Therefore, students can practice on cases that are relevant to them, and focus on the results of the analysis rather than (coding) procedures. See here.
Peter Ebbes: I am using Shiny in a similar way to what Emmanuel has described. For me, it offers a way to teach advanced statistical approaches while staying away from all the hard technical details. The students can apply the approach and focus on the business case rather than worrying about the mathematical details.
It also allows us to teach statistical approaches that are not available in standard software that we use in the core classes
It also allows us to teach statistical approaches that are not available in standard software that we use in the core classes. For instance, while SPSS or Excel are useful to do basic statistical analyses, they become limited very quickly when we need to teach more advanced topics that are nowadays becoming more main stream. The following app, for instance, performs a K-means clustering that we discuss in the core statistics class (MBA): http://rstudio-test.hec.fr/kmeans
What is the added value for your research?
Emmanuel Kemel: My research consists of comparing the performance of classical and behavioral economic theories for explaining choice behaviors.
I mainly use experimental-economics methods where I observe choices in experimental conditions.
I use Shiny to develop apps that display and collect subjects’ choices. R offers the possibility to create elegant displays and implement sophisticated strategies for collecting choices.
For example, it is possible to develop adaptative surveys when the questions evolve depending on previous answers. This allows us to finely and adaptively capture respondents’ preferences, which is impossible with static surveys.
For example, it is possible to develop adaptative surveys when the questions evolve depending on subject's previous answers
- Example of a survey I use in the classroom:
Survey on decisions
This survey was used to measure risk and time preferences of a representative sample (n=2000) of the French population. First results show that these measures are significant predictors of individual behavior in the domains of health and finance.
- Examples of apps developed by other users: https://shiny.rstudio.com/gallery
Peter Ebbes: I have not used Shiny for my research yet. However, I see many opportunities to do so.
In some of my research, we propose new methods of analysis for particular problems. In order to help disseminate the research among academics and practitioners, one could build a Shiny app that runs on a HEC server. The only thing that the user would need to do, is upload their dataset, after which the server will do the analysis and it will send back (e.g. email or for download) the results. This would help in particular with building citations for research papers.
In order to help disseminate the research among academics and practitioners, one could build a Shiny app that runs on a HEC server. The only thing that the user would need to do, is upload their dataset…
As an example, the Shiny app of McShane and Bockenholt (2017) about single paper meta-analysis has helped other researchers to implement their approach: https://blakemcshane.shinyapps.io/spmeta
McShane, Blake, and Ulf Bockenholt. 2017. Single Paper Meta-analysis: Benefits for Study Summary, Theory-testing, and Replicability. Journal of Consumer Research. 43(6): 1048-1063.