Package: sasLM 1.0.1

Kyun-Seop Bae

sasLM: 'SAS' Linear Model

This is a core implementation of 'SAS' procedures for linear models - GLM, REG, ANOVA, TTEST, FREQ, and UNIVARIATE. Some R packages provide Type II and Type III SS. However, the results of nested and complex designs are often different from those of 'SAS'. Different results do not necessarily mean incorrectness. However, many want the same results as 'SAS'. This package aims to achieve that. Reference: Littell RC, Stroup WW, Freund RJ (2002, ISBN:0-471-22174-0).

Authors:Kyun-Seop Bae [aut, cre]

sasLM_1.0.1.tar.gz
sasLM_1.0.1.tar.gz(r-4.7-any)sasLM_1.0.1.tar.gz(r-4.6-any)
sasLM_1.0.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
sasLM/json (API)

# Install 'sasLM' in R:
install.packages('sasLM', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

On CRAN:

Conda:

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

4.75 score 3 packages 40 scripts 1.1k downloads 1 mentions 157 exports 1 dependencies

Last updated from:8d37a619b9. Checks:4 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK138
source / vignettesOK223
linux-release-x86_64OK139
wasm-releaseOK112

Exports:addSigFieldLMafaov1aov2aov3aspirinCHDbacteriabeanyieldbearingBEdatabkbLbondreturnBPbrandtarbulblifeBYccdyieldCheckAliasCIestCollCONTRCor.testcorFishercSSCumAlphaCVdampoll1dampoll2defect1defect2dietwtDiffogramDriftdstrengthdynamitee1e2e3edupgmEMSestESTMestmbexExitPfeedmice1feedmice2feedsheepfertpest1fertpest2g2invG2SWEEPgeoCVgeoMeanGLMGrpCodehlpumpIQLMis.corkeyspeedKurtosisKurtosisSELCLleprosylfitllsm0lrlr0LSMlsm0MaxMeanMedianMinModelMatrixmtestNOBFBoundonewayOQLMORORcmhORinvORmnORmn1pBPcor.testpDPDIFFpigfeedpivotJplotDiffplotDunnettPocockBoundpResDptensileqcpassQuartileRangeRangeRanTestRDRDinvRDmnRDmn1REGregDrosemiteRRRRinvRRmnRRmn1rsdata0sattscore1score2ScoreCISDSEMseqBoundseqCIsignPDFLMsimxy1simxy2SkewnessSkewnessSESLICEsodiumsortColNameSSsumANOVAsumREGT3MST3testtemptrendtirewear1tirewear2tirewear3tmtesttoollifetransfattrimmedMeantsumtsum0tsum1tsum2tsum3TTESTtwowayUCLUNIVverifyPDFLMvtestWhiteHWhiteTestwriteMD5LMztest

Dependencies:mvtnorm

Bioequivalence and Crossover Analysis with sasLM
The standard 2x2 crossover analysis | Testing SEQ against the correct error term | The 90% confidence interval of the geometric mean ratio | Least squares means of treatments | Notes

Last update: 2026-07-14
Started: 2026-07-14

sasLM for SAS Users
Why sasLM? | Procedure-to-function map | PROC GLM | Expected mean squares and random effects | PROC REG | PROC TTEST | PROC UNIVARIATE | 2x2 tables | Notes

Last update: 2026-07-14
Started: 2026-07-14

Stratified 2x2 Tables: Miettinen-Nurminen and Friends
A single 2x2 table | Stratified analysis by the MN score method | Inverse variance (meta-analysis) and CMH methods | Example: aspirin and coronary heart disease | Choosing a method

Last update: 2026-07-14
Started: 2026-07-14

Readme and manuals

Help Manual

Help pageTopics
'SAS' Linear ModelsasLM-package sasLM
Add Acrobat-Reader signature fields to a report PDFaddSigFieldLM
Convert some columns of a data.frame to factorsaf
ANOVA with Type I SSaov1
ANOVA with Type II SSaov2
ANOVA with Type III SSaov3
An example dataset for meta-analysis - aspirin in coronary heart diseaseaspirinCHD
An Example Dataset of a Bioequivalence StudyBEdata
Beautify the output of knitr::kablebk
Analysis BY variableBY
Confidence Interval EstimationCIest
Collinearity DiagnosticsColl
F Test with a Set of ContrastsCONTR
Correlation test of multiple numeric columnsCor.test
Correlation test by Fisher's Z transformationcorFisher
Sum of Square with a Given Contrast SetcSS
Cumulative Alpha with various z's and tiCumAlpha
Coefficient of Variation in percentageCV
Plot Pairwise DifferencesDiffogram
Drift defined by Lan and DeMets for Group Sequential DesignDrift
Get a Contrast Matrix for Type I SSe1
Get a Contrast Matrix for Type II SSe2
Get a Contrast Matrix for Type III SSe3
Expected Mean Square FormulaEMS
Estimate Linear Functionsest
Estimate Linear FunctionESTIMATE ESTM
Estimability Checkestmb
Exit Probability with Cumulative Z-test in Group Sequential DesignExitP
Generalized type 2 inverse matrix, g2 inverseg2inv
Generalized inverse matrix of type 2 for linear regressionG2SWEEP
Geometric Coefficient of Variation in percentagegeoCV
Geometric Mean without NAgeoMean
General Linear Model similar to SAS PROC GLMGLM
Installation Qualification (IQ) report to a pdf fileIQLM
Is it a correlation matrix?is.cor
KurtosisKurtosis
Standard Error of KurtosisKurtosisSE
Lower Confidence LimitLCL
Linear Fitlfit
Linear Regression with g2 inverselr
Simple Linear Regressions with Each Independent Variablelr0
Least Squares MeansLSM
Max without NAMax
Mean without NAMean
Median without NAMedian
Min without NAMin
Model MatrixModelMatrix
Independent two groups t-test similar to PROC TTEST with summarized inputmtest
Number of observationsN
O'Brien-Fleming bounds for cumulative Z-test in Group Sequential DesignOBFBound
Operational Qualification (OQ) report to a pdf fileOQLM
Odds Ratio of two groupsOR
Odds Ratio of two groups with strata by the CMH methodORcmh
Odds Ratio of two groups with strata by the inverse variance methodORinv
Odds Ratio and Score CI of two groups with strata by the MN methodORmn
Odds Ratio and Score CI of two groups without strata by the MN methodORmn1
Plot Confidence and Prediction Bands for Simple Linear RegressionpB
Partial Correlation test of multiple columnsPcor.test
Diagnostic Plot for RegressionpD
Pairwise DifferencePDIFF
Pocock (fixed) Bound for the cumulative Z-test with a final target alpha-valuePocockBound
Residual Diagnostic Plot for RegressionpResD
Interquartile RangeQuartileRange
RangeRange
Test with Random EffectsRanTest
Risk Difference between two groupsRD
Risk Difference between two groups with strata by inverse variance methodRDinv
Risk Difference and Score CI between two groups with strata by the MN methodRDmn
Risk Difference and Score CI between two groups without strata by the MN methodRDmn1
Regression of Linear Least Square, similar to SAS PROC REGREG
Regression of Conventional Way with Rich DiagnosticsregD
Relative Risk of the two groupsRR
Relative Risk of two groups with strata by inverse variance methodRRinv
Relative Risk and Score CI of two groups with strata by the MN methodRRmn
Relative Risk and Score CI of two groups without strata by the MN methodRRmn1
Satterthwaite Approximation of Variance and Degrees of Freedomsatt
Score Confidence Interval for a Proportion or a Binomial DistributionScoreCI
Standard DeviationSD
Standard Error of the Sample MeanSEM
Sequential bounds for cumulative Z-test in Group Sequential DesignseqBound
Confidence interval with the last Z-value for a group sequential designseqCI
Digitally sign and verify a PDF reportsignPDFLM verifyPDFLM
SkewnessSkewness
Standard Error of SkewnessSkewnessSE
F Test with SliceSLICE
Sum of SquareSS
Type III Expected Mean Square FormulaT3MS
Test Type III SS using an error term other than MSET3test
Independent two means test similar to t.test with summarized inputtmtest
Trimmed MeantrimmedMean
Table Summarytsum
Table Summary with 0 independent (x) variablestsum0
Table Summary with 1 independent (x) variabletsum1
Table Summary with 2 independent (x) variablestsum2
Table Summary with 3 independent (x) variablestsum3
Independent two groups t-test comparable to PROC TTESTTTEST
Upper Confidence LimitUCL
Univariate Descriptive StatisticsUNIV
F-Test for the ratio of two groups' variancesvtest
White's Model Specification TestWhiteTest
Write the MD5 integrity manifest for an installed packagewriteMD5LM
Test for the difference of two groups' meansztest