From what I’ve seen, a lot of the statistical analysis of data from composite material data is done in MS Excel. There are a number of very good tools for doing this analysis in MS Excel: ASAP, HYTEQ, STAT-17, and more recently, CMH17-STATS. I expect that the reason for the popularity of MS Excel for this application is that everyone in the industry has MS Excel installed on their computer and MS Excel is easy to use.

If you’ve read my blog before, you’ll know that I think that reproducibility is important for engineering calculations. In my view, this includes statistical analysis. If the analysis isn’t reproducible, how does a reviewer — either now or in the future — know if it’s right?

The current MS Excel tools are typically password protected so that users can’t view the macros that perform the calculations. I suspect that this was done with the best of intentions in order to prevent users from changing the code. But it also means that users can’t verify that the code is correct, or check if there are any unstated assumptions made.

To allow statistical analysis of composite material data using open-source software, I’ve written an package for the R programming language that implements the statistical methods described in CMH-17-1G. This package, cmstatr has been released on CRAN. There is also a brief discussion of this package in a paper published in the Journal of Open Source Software.

This R package allows statistical analysis to be performed using open-source tools — which can be verified by the user — and facilitates statistical analysis reports to be written at the same time that the analysis is performed by using R-Notebooks (see my earlier post).

I’ve tried to write the functions in a consistent manner so that it’s easier to learn how to use the package. I’ve also written functions to work well with the tidyverse set of packages.

There are some examples of how to use the cmstatr package in this vignette.

I hope that people find this package useful. If you use this package and find a bug, have feedback or would like a feature added, please raise an issue on GitHub.