Type B

using Metida, CSV, DataFrames, CategoricalArrays
# example data
df = CSV.File(joinpath(dirname(pathof(Metida)), "..", "test", "csv", "df0.csv")) |> DataFrame;
transform!(df, :subject => categorical, renamecols=false)
transform!(df, :period => categorical, renamecols=false)
transform!(df, :sequence => categorical, renamecols=false)
transform!(df, :formulation => categorical, renamecols=false)

lmm = LMM(@formula(var~sequence+period+formulation), df;
random = VarEffect(@covstr(1|subject), SI),
)
fit!(lmm)
ci = confint(lmm)[end]
exp.(ci) .* 100.0
(76.90151459649938, 110.99459058562884)

Type C

lmm =LMM(@formula(var~sequence+period+formulation), df;
random = VarEffect(@covstr(formulation|subject), CSH),
repeated = VarEffect(@covstr(formulation|subject), DIAG),
)
fit!(lmm)
ci = confint(lmm)[end]
exp.(ci) .* 100.0
(73.6627777052293, 115.87469810342586)

Reference