IQLM added: a self-contained Installation Qualification (IQ) report in pdf documenting whether sasLM is correctly installed, intact, loadable, and operational (environment, version, dependency satisfaction, MD5 file integrity, namespace/exports, a functional GLM check against a SAS reference, an overall QUALIFIED/NOT QUALIFIED verdict, a sessionInfo appendix, and a per-file md5 checksum appendix).
OQLM added: a self-contained Operational Qualification (OQ) report in pdf. It runs a set of GLM scenarios (shipped in ‘inst/OQ’) on the user's machine and lists every computed value - the ANOVA table, the fit statistics, and the Type I, II and III sums of squares - next to its SAS/textbook reference value, with the absolute and relative difference and a pass flag, and an overall verdict. The first release covers GLM; other procedures can be added by extending ‘inst/OQ’. Reference values are the SAS PROC GLM / textbook results documented in the package validation report.
writeMD5LM added: writes the standard R ‘MD5’ integrity manifest into an installed package directory (using tools::md5sum) so that the IQLM file-integrity check reports PASS for local installs. CRAN installs already include this manifest.
addSigFieldLM added (and a sigField argument to IQLM/OQLM): insert Adobe Acrobat Reader signature fields into the report PDF (pure base-R PDF incremental update, no external tools) so it can be signed with one click in the free Acrobat Reader, instead of printing and scanning.
signPDFLM and verifyPDFLM added: digitally sign a report PDF (a detached SHA-256 signature written to ‘<pdf>.sig’, using the openssl package) and verify it, as a scriptable alternative.
No change to any existing computation. The three vignette sources (‘bioequivalence-with-sasLM.Rmd’, ‘sasLM-for-SAS-users.Rmd’, ‘stratified-2x2-tables.Rmd’) were moved from ‘inst/doc’ to the standard ‘vignettes’ directory and VignetteBuilder: knitr was declared, so the vignettes are registered and rebuilt by the build tools instead of being shipped as pre-built static files.
The static validation report PDFs were moved from ‘inst/doc’ to ‘inst/extdoc’ so they are plain installed files (they were never registered vignettes) and are no longer removed by build tools that treat ‘inst/doc’ as a vignette-output directory.
First stable release.
Large speed-up for big data: Type II/III contrast generation (ex, e2, e3) and REG no longer form an n-by-n projection (hat) matrix. With 20,000 rows and about 60 columns, GLM is more than 100 times faster (165 s to 1.3 s), REG about 48 times, and aov2/aov3/EMS/RanTest/T3test benefit similarly. Results are unchanged.
GLM and REG with Weights: Fitted and Residual are now returned in the original scale as SAS OUTPUT P= R= does. Previously they were returned in the sqrt(weight)-transformed scale.
GLM and REG with Weights: observations with nonpositive weights are now excluded from the analysis (including degrees of freedom) as SAS does, with a warning.
GLM and REG now validate the length of Weights and align it correctly when rows with NA are dropped from Data.
PDIFF with adj="dunnett": ref now defaults to the first level as SAS does, an invalid ref is rejected with a clear message, and the two-level case no longer fails.
UNIV now uses quantile type 2 (the SAS default) for Q1, Q3, and IQR as documented. It previously used type 6, the SPSS default.
All manual pages were reviewed and revised: typos and grammar corrected, and several value sections were aligned with the actual outputs (Cor.test, RDinv, RRinv, ORinv, ORcmh, UNIV, regD, seqBound, OR).
RDmn (stratified) confidence bounds now use the score statistic recomputed at each candidate value instead of a fixed point estimate approximation, and root-finding tolerances in RDmn and RRmn are tightened to 1e-10. RDmn and RRmn now agree with ratesci::scoreci(weighting="MN", skew=FALSE) to 8 decimal places including zero-cell strata.
ORmn (stratified) is improved as planned since 0.10.6. It now uses the inverse-variance weighted score with the score bias correction, and the common odds ratio point estimate is the zero of the weighted score statistic. It agrees with ratesci::scoreci(contrast="OR", stratified=TRUE, skew=FALSE) by Pete Laud to 7 decimal places over standard, multi-strata, zero-cell, and extreme cases. ORmn1 (single stratum) remains the classical Miettinen-Nurminen interval.
Code quality improvement: T/F replaced with TRUE/FALSE for CRAN policy compliance.
Global assignment (<<-) in ORmn removed using environment object pattern.
options(warn) replaced with suppressWarnings() in ORmn, RRmn, RDmn, RDmn1 to prevent options leak on error.
Unsafe 1:length() pattern replaced with seq_along()/seq_len() across 14 files.
Redundant comparison in G2SWEEP (BasicUtil.R) fixed.
Max function uses na.rm=TRUE for consistency with Min.
DESCRIPTION cleaned up: removed redundant Author/Maintainer fields.
CumAlpha function improved to handle changing z values and arbitrary time points.
OBFBound function added for exact O'Brien-Fleming bounds.
GLM function validated again, and the result is OK.
Thanks to Pete Laud, RDmn and RRmn are corrected. ORmn will be improved further later.
RDmn1 for extreme case (R1=1, R2=1) fixed.
g2inv function bug with p=0 fixed.
UNIV can compute geometric mean and CV excluding NA values
g2inv function for generalized type 2 inverse matrix for non-square matrix is newly introduced.
G2SWEEP checks if the input is a square matrix.
dunnett adjustment no longer use Miwa algorithm
Functions for group sequential design (seqBound, CumAlpha, PocockBound, Drift, ExitP, seqCI) are added.
If the matrix dimension for Dunnett test is less than 11, Miwa algorithm is used for multi-variate t distribution.
RRinv revised
RDmn1 can handle more extreme cases.
Typo correction
TTEST, mtest, tmtest, ztest, vtest functions are added.
Every time just before calling mvtnorm::pmvt, mvtnorm::qmvt, set.seed(5) is called.
RanTest with no fixed effect and only 1 random effect return correct result.
T3test supports H and E options
LIbin, LIpois, LInorm, and RDLI are removed, and will be included in a separate package.
Skewness function revised.
Bugs of some cases at RDmn1, RDmn, ORmn1, ORmn are fixed.
LIbin, LIpois, LInorm, and RDLI are introduced.
RanTest function added for test with random effect.
T3MS will be deprecated soon. Use EMS instead.
SLICE function's options are renamed.
Typos in manual are corrected.
GLM, REG, aov1, aov2, aov3 functions return yhat and residuals with Resid=TRUE option.
aov1, aov2, aov3 functions return beta coefficients with BETA=TRUE option.
T3test is significantly improved for complex cases.
RDmn handles more extreme values.
LSM plotting order is ascending by default.
ORmn: Special cases of OR - 0, infinity or NaN - are checked in the input.
GLM and REG supports weighted regression with WEIGHTS option.
REG displays tests using HC0, HC3, and White's first and second moment specification test.
Code refactored to cope better with a singular or ill-conditioned matrix.
Some unused arguments such as eps (in GLM, REG, aov1, aov2, and aov3) are removed.
e1, e2, e3 arguments are simplified to reduce unnecessary calculation.
corFisher function for correlation test by Fisher's Z transformation is added.
RDmn, RRmn, ORmn use MN weights for point estimates also.
RDmn1 finds confidence interval better.
Some typo fixed.
RDinv, RRinv, ORinv, ORcmh for stratified or meta-analysis of 2x2 are added.
GLM reports adjusted R-squared
QuartileRange returns type 2 IQR by default.
UNIV returns MAD and type 2 IQR too.
Coll calculates like SAS, not like SPSS
lfit help updated
RD, RR, OR, RDmn1, RRmn1, ORmn1, RDmn, RRmn, ORmn functions for 2x2 table with or without stratification are added.
Description corrected in satt help.
GLM function's arguments changed: SOLUTION to BETA, LSMEANS to EMEAN
ANOVA function is removed, because it is almost a duplicate of GLM function.
GLM function's arguments changed.
Descriptive statistics functions such as N, Mean, SD, SEM, Min, Max, Median, UCL, LCL, trimmedMean, Range, QuartileRange, Skweness, SkewnessSE, Kurtosis, KurtosisSE now accept a non-numeric vector that can be converted to a numeric vector.
A bug with no incercept model in e3 is fixed.
A bug at "adj" option in LSM fixed, which also affects GLM.
PLOT option related codes are revised.
UNIV added for descriptive statistics
G2SWEEP became faster for large sparse matrix
REG function warns in case of completely aliased model and data and increases epsilon tolerance to 1e-5.
Diffogram and plotDiff option 'Title' removed. Use 'main' option instead.
Descriptive statistic functions (Mean, SD, ...) return NA with inappropriate inputs.
geoMean and geoCV added
reverse option added to PDIFF
Diffogram added
PLOT option added to LSM and PDIFF
LSM supports grouping when a term is specified.
PDIFF and est support common multiple comparison methods, such as "lsd"(no adj), "bon", "tukey", "scheffe", "duncan", and "dunnett".
ESTM function added.
CONTR function added.
SLICE function added.
satt changed the way of weights calculation. Now, one can give integer weights.
lsm now properly supports models without intercept.
e2 now properly supports single factor models (Type II SS of Oneway ANOVA) without intercept.
Checks inputs and errors during calculation more.
aov2 and e2 support no intercept model.
aov1, aov3, ANOVA, GLM handle no intercept model properly.
A column of estimability will be shown when some coefficients are not estimable in REG and GLM.
Some errata in help/manual are corrected.
CV (coefficient of variation) in percentage added.
cSS has now m arguments for non-zero mean hypothesis.
A bug with no intercept model in lr fixed.
Incomplete interaction term names of PDIFF fixed.
LSM does not show estimates which are not estimable, and supports more models
est has more arguments to test estimability
lr0 function for simple linear regressions with each independent variable
lr function for linear regression with g2 inverse
tsum wrapper function for tsum0, tsum1, tsum2, tsum3
bt function removed to remove dependency on knitr
NOINT option in REG, ModelMatrix is removed. Use conventional R formula.
Order of coefficients (parameters) changed to be more similar to SAS.
T3MS revived.
EMS has different arguments from T3MS.
GLM function now has lsm option for least square mean
LSM function added for Least Square Means in SAS
PDIFF to do pairwise comparison
BY function to run functions by levels of a variable
tsum0, tsum1, tsum2, tsum3 functions for the summary table of a continuous dependent variable
bk function to beautify the output of knitr::kable()
bt function to beautify the output of tsum2, tsum3
G2SWEEP function explained
regD function optimized
T3MS renamed as EMS, because it can handle other types also.
CIest function's arguments and return values changed.
regD function added for influence diagnostics
T3test a bug fixed for one row table
CIest added for confidence interval estimation
e3 function revised for RANDOM test functionality
satt added for Satterthwaite approximation
T3MS added for Type 3 Expected Mean Square formula
T3test added for hypothesis test with different error term
Unnecessary lines in source removed
Contrast input for cSS changed from column vectors to row vectors.
REG can return lfit result with summarize=FALSE argument.
Type III SS function improved
Miscellaneous errata corrected
Code refactored
An erratum is fixed
First version
TO DO: Function to add - e4, aov4
TO DO: Items to add - R2, R2ADJ - v0.4.1 lr does this.