Learn R Programming

sasLM (version 1.0.1)

'SAS' Linear Model

Description

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).

Copy Link

Version

Install

install.packages('sasLM')

Monthly Downloads

1,385

Version

1.0.1

License

GPL-3

Maintainer

Kyun-Seop Bae

Last Published

July 14th, 2026

Functions in sasLM (1.0.1)

ModelMatrix

Model Matrix
Median

Median without NA
PDIFF

Pairwise Difference
LCL

Lower Confidence Limit
LSM

Least Squares Means
OR

Odds Ratio of two groups
OBFBound

O'Brien-Fleming bounds for cumulative Z-test in Group Sequential Design
ORmn1

Odds Ratio and Score CI of two groups without strata by the MN method
ORcmh

Odds Ratio of two groups with strata by the CMH method
OQLM

Operational Qualification (OQ) report to a pdf file
Max

Max without NA
G2SWEEP

Generalized inverse matrix of type 2 for linear regression
QuartileRange

Interquartile Range
Mean

Mean without NA
RD

Risk Difference between two groups
Pcor.test

Partial Correlation test of multiple columns
Min

Min without NA
SD

Standard Deviation
SEM

Standard Error of the Sample Mean
ScoreCI

Score Confidence Interval for a Proportion or a Binomial Distribution
RDmn1

Risk Difference and Score CI between two groups without strata by the MN method
RDmn

Risk Difference and Score CI between two groups with strata by the MN method
RDinv

Risk Difference between two groups with strata by inverse variance method
RRmn1

Relative Risk and Score CI of two groups without strata by the MN method
PocockBound

Pocock (fixed) Bound for the cumulative Z-test with a final target alpha-value
RRmn

Relative Risk and Score CI of two groups with strata by the MN method
RRinv

Relative Risk of two groups with strata by inverse variance method
RR

Relative Risk of the two groups
N

Number of observations
RanTest

Test with Random Effects
ORinv

Odds Ratio of two groups with strata by the inverse variance method
Skewness

Skewness
af

Convert some columns of a data.frame to factors
ORmn

Odds Ratio and Score CI of two groups with strata by the MN method
aov1

ANOVA with Type I SS
Range

Range
SkewnessSE

Standard Error of Skewness
REG

Regression of Linear Least Square, similar to SAS PROC REG
T3MS

Type III Expected Mean Square Formula
aov3

ANOVA with Type III SS
aov2

ANOVA with Type II SS
e1

Get a Contrast Matrix for Type I SS
e2

Get a Contrast Matrix for Type II SS
SLICE

F Test with Slice
e3

Get a Contrast Matrix for Type III SS
est

Estimate Linear Functions
SS

Sum of Square
mtest

Independent two groups t-test similar to PROC TTEST with summarized input
bk

Beautify the output of knitr::kable
aspirinCHD

An example dataset for meta-analysis - aspirin in coronary heart disease
pB

Plot Confidence and Prediction Bands for Simple Linear Regression
geoCV

Geometric Coefficient of Variation in percentage
geoMean

Geometric Mean without NA
lr

Linear Regression with g2 inverse
WhiteTest

White's Model Specification Test
seqCI

Confidence interval with the last Z-value for a group sequential design
pD

Diagnostic Plot for Regression
tsum

Table Summary
pResD

Residual Diagnostic Plot for Regression
tsum0

Table Summary with 0 independent (x) variables
lr0

Simple Linear Regressions with Each Independent Variable
corFisher

Correlation test by Fisher's Z transformation
cSS

Sum of Square with a Given Contrast Set
lfit

Linear Fit
is.cor

Is it a correlation matrix?
T3test

Test Type III SS using an error term other than MSE
UCL

Upper Confidence Limit
estmb

Estimability Check
UNIV

Univariate Descriptive Statistics
TTEST

Independent two groups t-test comparable to PROC TTEST
trimmedMean

Trimmed Mean
vtest

F-Test for the ratio of two groups' variances
addSigFieldLM

Add Acrobat-Reader signature fields to a report PDF
tsum3

Table Summary with 3 independent (x) variables
tmtest

Independent two means test similar to t.test with summarized input
g2inv

Generalized type 2 inverse matrix, g2 inverse
writeMD5LM

Write the MD5 integrity manifest for an installed package
regD

Regression of Conventional Way with Rich Diagnostics
satt

Satterthwaite Approximation of Variance and Degrees of Freedom
sasLM-package

'SAS' Linear Model
seqBound

Sequential bounds for cumulative Z-test in Group Sequential Design
ztest

Test for the difference of two groups' means
tsum1

Table Summary with 1 independent (x) variable
tsum2

Table Summary with 2 independent (x) variables
signPDFLM

Digitally sign and verify a PDF report
CIest

Confidence Interval Estimation
BEdata

An Example Dataset of a Bioequivalence Study
Coll

Collinearity Diagnostics
BY

Analysis BY variable
Diffogram

Plot Pairwise Differences
CONTR

F Test with a Set of Contrasts
CV

Coefficient of Variation in percentage
Cor.test

Correlation test of multiple numeric columns
KurtosisSE

Standard Error of Kurtosis
Kurtosis

Kurtosis
ESTM

Estimate Linear Function
EMS

Expected Mean Square Formula
GLM

General Linear Model similar to SAS PROC GLM
DoEdata

Example Datasets
CumAlpha

Cumulative Alpha with various z's and ti
BasicUtil

Internal Functions
ExitP

Exit Probability with Cumulative Z-test in Group Sequential Design
IQLM

Installation Qualification (IQ) report to a pdf file
Drift

Drift defined by Lan and DeMets for Group Sequential Design