SASLMR

Documentation for SASLMR.

This program comes with absolutely no warranty. No liability is accepted for any loss and risk to public health resulting from use of this software.

SASLMR.jl is Julia package, it wrapp sasLM package for R project for ANOVA type I/II/III.

Exported functions: aov1, aov2, aov3, aov, ciest, rantest

Install:

import Pkg; Pkg.add(url="https://github.com/PharmCat/SASLMR.jl.git")

Note:

SASLMR.jl doesn't install sasLM. To use SASLMR.jl first install sasLM in your R project enviroment. Check that R project is included in PATH, and check that RCall.jl builded successfully.

Using:

using SASLMR
using StatsModels, StatsBase, DataFrames

# data (DataFrame)
bedf = SASLMR.bedata()

# run ANOVA
beaov = SASLMR.aov(@formula(CMAX ~  PRD + TRT + SEQ + SUBJ&SEQ), bedf; beta=true, resid=true, type = "III")

# get DF
beaovdf = DataFrame(beaov.ct)

# or get coeftable

ct = coeftable(beaov)

For more details see:

https://cran.r-project.org/web/packages/sasLM/sasLM.pdf

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7781810/

SASLMR.jl not cover all sasLM functionality... so... wellcome any PR for extending.

SASLMR.aovMethod
aov(f, d; beta=true, resid=true, type = "III")

Same as aov1, aov2, aov3.

Keyword type: ANOVA SS Type I/II/III (III by default).

source
SASLMR.aov1Method
aov1(f, d; beta=true, resid=true)

Function:

aov1(Formula, Data, BETA=FALSE, Resid=FALSE)

ANOVA with Type I SS.

Arguments:

Formula a conventional formula for a linear model.

Data a data.frame to be analyzed

BETA if TRUE, coefficients (parameters) of REG will be returned. This is equivalent to SOLUTION option of SAS PROC GLM

Resid if TRUE, fitted values (y hat) and residuals will be returned

Details

It performs the core function of SAS PROC GLM, and returns Type I SS. This accepts continuous independent variables also.

Value

The result table is comparable to that of SAS PROC ANOVA.

Df degree of freedom

Sum Sq sum of square for the set of contrasts

Mean Sq mean square

F value F value for the F distribution

Pr(>F) proability of larger than F value

Next returns are optional.

Parameter Parameter table with standard error, t value, p value. TRUE is 1, and FALSE is 0 in the Estimable column. This is returned only with BETA=TRUE option.

Fitted Fitted value or y hat. This is returned only with Resid=TRUE option.

Residual Weigthed residuals. This is returned only with Resid=TRUE option.

source
SASLMR.aov2Method
aov2(f, d; beta=true, resid=true)

Function:

aov2(Formula, Data, BETA=FALSE, Resid=FALSE)

ANOVA with Type II SS.

Description see aov1.

source
SASLMR.aov3Method
aov3(f, d; beta=true, resid=true)

Function:

aov3(Formula, Data, BETA=FALSE, Resid=FALSE)

ANOVA with Type III SS.

Description see aov1.

source
SASLMR.bedataMethod
bedata()

Return BEdata (Contains Cmax data from a real bioequivalence study).

source
SASLMR.ciestMethod
ciest(f, d, term, contrast; level = 0.95, est = false)

If est == true - return estimate table.

CIest(Formula, Data, Term, Contrast, conf.level=0.95)

Get point estimate and its confidence interval with given contrast and alpha value using t distribution.

source
SASLMR.rantestMethod
rantest(f, d, random; type = "III", eps::Float64 = 1e-8)

Hypothesis test of with specified type SS using random effects as error terms. This corresponds to SAS PROC GLM’s RANDOM /TEST clause

Same as:

RanTest(f, d, Random = "", Type=3, eps=1e-8)

Type can be from 1 to 3. All interaction terms with random factor are regarded as random effects. Here the error term should not be MSE

Returns ANOVA and E(MS) tables with specified type SS.

source