Customer Stories

SAS to R Migration: How a Global Healthcare Leader Cut Licensing Costs

AI Consulting
The post thumbnail

OUR CLIENT

A Global Healthcare and Life Sciences Company

Our client is a global leader in the healthcare and life sciences sector, developing and commercializing products used across clinical and laboratory settings worldwide. The company’s Data Science team is responsible for running precision analyses that underpin product performance claims submitted to major regulatory bodies, including the FDA and EMA.

With a large product portfolio in continuous development and regulatory submission cycles that demand rigorous, reproducible statistical outputs, the organization relies on a tightly controlled analytical environment. Accuracy, traceability, and compliance are non-negotiable. So is operational efficiency.

This combination of scientific rigor and cost discipline is precisely the kind of challenge Algomine is built to solve. We bring deep expertise in migrating validated analytical workflows from legacy platforms to modern, open-source environments across regulated healthcare and life sciences organizations.

BUSINESS CHALLENGE

A Workflow Built on SAS and the Growing Cost of Keeping It There

At the heart of the client’s product development process sits a precision analysis workflow built in SAS. Executed in accordance with CLSI EP5-A3 guidelines, the workflow quantifies analytical variability for diagnostic products and generates statistical outputs that feed directly into product labeling documentation.

The workflow was well-established and validated. But it came with a significant and growing overhead: SAS licensing costs. As the organization evaluated its long-term analytics strategy, the dependency on a single, proprietary vendor became increasingly difficult to justify, particularly given that the statistical methods involved are fully reproducible in open-source environments. Organizations across healthcare, finance, and insurance are facing the same inflection point for the same reasons.

Beyond cost, the client identified additional friction in the existing process:

  • Vendor lock-in risk. Reliance on SAS created a single point of failure in the analytical infrastructure, with limited flexibility to adapt or extend the workflow. The full cost of remaining on SAS goes well beyond the license fee itself. For a detailed breakdown, see our SAS migration cost analysis.
  • Limited process automation. The workflow required multiple manual steps, including outlier removal by editing Excel rows, manual log retrieval, and repetitive graph regeneration due to formatting issues. Each step consumed analyst time without adding analytical value.
  • Suboptimal output structure. Generated outputs were not organized to align with the reporting workflow, requiring analysts to search across files when assembling the final statistical report.
  • No standalone outlier detection. Analysts who needed only the ESD (Extreme Studentized Deviate) outlier detection results were required to run the entire analysis to access them.

The question was not whether to migrate, but how to do so in a way that preserved statistical equivalence, maintained compliance with internal validation SOPs, and used the transition as an opportunity to meaningfully improve the workflow.

OUR SOLUTION & APPROACH

A Structured Migration Built on Discovery, Precision, and Open-Source Expertise

Phase 1: Feasibility and Technical Assessment

Algomine approached the engagement in two phases designed to minimize risk and maximize confidence before a single line of code was rewritten. A phased approach is fundamental to any successful SAS migration program, and this engagement was no exception.

We conducted a 5-day on-site discovery workshop with the client’s Data Science team, followed by a 5-day off-site analysis and documentation phase. Structured across four discovery tracks (workflow understanding, statistical and reporting logic, execution environment, and risk and validation landscape), the assessment produced a complete picture of the existing process and confirmed that migration was technically, operationally, and regulatorily viable.

A key finding that reduced risk significantly: the client already operated an RStudio Server environment deployed on Kubernetes via JupyterHub. This meant no new infrastructure investment was required. The migrated workflow could be hosted directly on existing, already-validated open-source infrastructure.

Phase 2: Migration

With feasibility confirmed, we proceeded to migrate the full analytical codebase, approximately 12,000 lines of validated SAS code, into a dedicated, internally compiled R package. The core elements of the migration included:

  • Full SAS-to-R rewrite of all analytical scripts, ensuring statistical equivalence across mixed-effects models (REML), outlier detection, variance comparison, and descriptive statistics.
  • R package architecture, preventing unauthorized modifications to validated code and ensuring controlled versioning via GitLab integration. One of the most consistent challenges in migrations of this kind is achieving precise numerical equivalence between SAS and R outputs. We addressed this through rigorous parallel testing. For a detailed look at how to manage numerical and statistical output differences in SAS migrations, including tolerance thresholds and validation strategy, see our dedicated guide.
  • Industry-standard open-source package selection, leveraging the same pharmaverse ecosystem used by leading global pharmaceutical companies, including mmrm for REML modelling, rtables for structured table generation, and ggplot2 for publication-ready visualizations.
  • Package version freezing via renv, ensuring long-term reproducibility of validated analyses and compliance with internal validation SOPs.
  • VBA macro update, adapting the existing Excel-based parametrization workflow to export configuration files to the directory structure accessible by the RStudio Server.

Alongside the core migration, we introduced a set of workflow enhancements that reduced manual effort without touching the underlying statistical logic:

  • A standalone outlier detection run mode, allowing analysts to obtain ESD results independently without executing the full analysis.
  • Automated, timestamped logging stored alongside results, improving traceability and simplifying troubleshooting.
  • A pre-structured report template pre-populated with standard tables and graphs, significantly reducing manual report assembly time.
  • Reorganized output file structure aligned with the reporting workflow.
  • Improved graph label handling, eliminating the need for manual graph regeneration outside the tool.

Technology Stack

  • R (compiled internal package)
  • Pharmaverse ecosystem: mmrm, rtables, gtsummary, ggplot2
  • renv for dependency management
  • RStudio Server on JupyterHub / Kubernetes
  • GitLab for version control and audit trail
  • LDAP + Docker container isolation for access control

RESULTS & IMPACT

Licensing Costs Eliminated. Workflow Measurably Improved.

The migration delivered immediate and long-term value across three dimensions:

Cost Optimization By transitioning from a proprietary SAS environment to an open-source R stack hosted on existing infrastructure, the client eliminated SAS licensing costs entirely for this analytical process. With multiple SAS-based workflows remaining in the organization’s portfolio, this project establishes a validated, repeatable blueprint for broader cost reduction across the analytics function.
Operational Efficiency The workflow improvements introduced during migration directly reduce the manual burden on Data Science analysts. Standalone outlier detection, automated logging, and a pre-structured report template together eliminate hours of repetitive work per study, across what can be dozens of studies annually.
Future-Proofed Infrastructure The R-based solution is fully compatible with the client’s cloud migration roadmap. The modular R package architecture makes it straightforward to extend, update, or audit the workflow as analytical requirements evolve.

 

KEY TAKEAWAYS

What This Migration Proves

SAS to R migration is viable and often lower risk than organizations expect. When the existing workflow is classified as Non-Product Software (NPSW) and the statistical methods are standard, the primary challenge is execution quality, not regulatory feasibility.

Industry-standard open-source packages remove the hardest part of the compliance question. The pharmaverse ecosystem provides validated, industry-accepted components for precisely the kind of mixed-model clinical analysis that characterizes precision studies in healthcare and life sciences.

Migration is an opportunity, not just a cost exercise. Every organization that has run SAS workflows for years has accumulated inefficiencies that felt too risky to address. A structured migration creates the right context to resolve them cleanly, without changing statistical logic or re-triggering validation from scratch.

Reuse existing infrastructure. Organizations already running RStudio, JupyterHub, or other open-source environments have a natural landing zone for migrated workflows. The incremental cost of migration is far lower than it appears when the infrastructure layer is already in place.

Start with a feasibility assessment. A short, structured discovery engagement significantly de-risks the migration decision. For biostatistical workflows in regulated environments, investing in that clarity upfront is always the right move. Our SAS migration checklist covers every phase from pre-migration stakeholder alignment through final decommission.

CONTACT US

Is your organization evaluating a migration from SAS to R or Python?

Whether you are looking to reduce licensing overhead, modernize a validated analytical environment, or establish an open-source statistical computing platform, our team has the expertise to take you from feasibility through production – contact us.