knitr::opts_chunk$set(comment = NA) options(width = 100) library(sasLM)
Average bioequivalence with a 2x2 crossover design is conventionally analyzed with SAS PROC GLM:
PROC GLM DATA=be; CLASS SEQ SUBJ PRD TRT; MODEL LNCMAX = SEQ SUBJ(SEQ) PRD TRT; RANDOM SUBJ(SEQ) / TEST; LSMEANS TRT / CL ALPHA=0.1; ESTIMATE 'T - R' TRT -1 1 / CL ALPHA=0.1; RUN;
The package ships BEdata, real data from a 2x2 bioequivalence study with three
hospitalization groups. The same analysis with sasLM:
BEdata = af(BEdata, c("ADM", "SEQ", "PRD", "TRT", "SUBJ")) # columns as factors formula1 = log(CMAX) ~ SEQ/SUBJ + PRD + TRT GLM(formula1, BEdata)
SEQ/SUBJ denotes subjects nested within sequence, equivalent to
SEQ SUBJ(SEQ) of SAS. The Type I, II, and III tables above match SAS PROC GLM
for this unbalanced data set (91 subjects).
The sequence effect must be tested against the subject-within-sequence mean square, not the residual. This is what the RANDOM / TEST statement of SAS does:
RanTest(formula1, BEdata, Random="SUBJ")
The two-one-sided-tests (TOST) procedure at the 5% level is operationally the 90% confidence interval of T/R in the log scale:
ci0 = CIest(formula1, BEdata, "TRT", c(-1, 1), conf.level=0.90) ci0 exp(ci0[, c("Estimate", "Lower CL", "Upper CL")]) # GMR and its 90% CI
The exponentiated estimate and confidence limits are the geometric mean ratio (GMR) and its 90% confidence interval. Bioequivalence is concluded when the interval is contained in [0.80, 1.25].
LSM(formula1, BEdata, "TRT", conf.level=0.90)
?sasLM for the equivalent nlme::lme call.Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.