Learn R Programming

sasLM (version 1.0.1)

OQLM: Operational Qualification (OQ) report to a pdf file

Description

Generate a self-contained PDF report that documents whether the sasLM linear-model engine reproduces pre-specified reference results on the user's own machine, within a pre-specified relative tolerance. It is intended as Operational Qualification (OQ) evidence. For each scenario the report lists every computed value - the ANOVA table, the fit statistics, and the Type I, II and III sums of squares - next to its reference value, with the absolute and relative difference and a pass flag, then an overall verdict. It uses only base R and the package's pdf helpers (no LaTeX). The signature page is first; 1 inch margins; Letter paper in a United States locale and A4 elsewhere.

Usage

OQLM(fileName = "sasLM-OQ-Report.pdf", cfg = NULL, tol = 0.001,
     refDir = system.file("OQ", package = "sasLM"), performedBy = "",
     paper = "auto", sigField = FALSE)

Value

Invisibly, a list with fileName, qualified, tol, nScenarios, nFailScenarios, nValues, nFailValues, paper, and results (a per-scenario list whose comp element is the full table of every comparison). A PDF is written to fileName.

Arguments

fileName

file name to save the PDF report.

cfg

a data frame of scenario definitions. If NULL, the manifest OQcfg.csv in refDir is used. It must have the columns id, desc, datafile (an input csv in refDir), formula, factors (semicolon-separated column names made factors with af), reffile (the reference csv in refDir), and source (a citation). Each reference csv has columns table (ANOVA, Fitness, TypeI, TypeII or TypeIII), term, stat, and value.

tol

acceptance tolerance: a value passes when the symmetric relative difference abs(ref - obs) / ((abs(ref) + abs(obs))/2) is at most tol; an absolute fallback is used when both values are essentially zero.

refDir

directory holding OQcfg.csv, the input data, and the reference csv files. Defaults to the OQ folder installed with sasLM.

performedBy

name of the person performing the qualification, printed on the signature page. Defaults to the login name.

paper

paper size: "letter", "a4", or "auto" (the default; Letter in a United States locale, A4 elsewhere).

sigField

if TRUE, add Adobe Acrobat Reader signature fields to the finished report (via addSigFieldLM) so it can be signed with one click in Acrobat Reader.

Author

Kyun-Seop Bae <k@acr.kr>

Details

For each scenario the function reads the (frozen) input data, makes the named columns factors with af, fits the model with GLM, flattens the result, and compares every reference value to the corresponding computed value. A scenario passes only when all of its values pass.

The first release covers GLM with scenarios from Harvey (ARS20-8) and Goodnight (1976). The bundled reference values are the SAS PROC GLM / textbook results documented in the package validation report (Validation of 'sasLM' Package); they establish concordance with SAS, the de-facto reference. A new GLM scenario can be added with no code change, by adding an input csv, a reference csv, and one row to OQcfg.csv in refDir. Adding a different procedure (such as REG, aov3, TTEST or UNIV) additionally requires extending OQLM itself (procedure dispatch and result flattening).

See Also

IQLM, writeMD5LM, GLM

Examples

Run this code
#OQLM()
#res <- OQLM(); res$qualified; res$results[[1]]$comp

Run the code above in your browser using DataLab