Constrained inference for linear fixed or mixed effects models using distribution-free bootstrap methodology
clme(
formula,
data = NULL,
gfix = NULL,
constraints = list(),
tsf = lrt.stat,
tsf.ind = w.stat.ind,
mySolver = "LS",
all_pair = FALSE,
verbose = c(FALSE, FALSE, FALSE),
...
)
a formula expression. The constrained effect must come before any unconstrained covariates on the right-hand side of the expression. The constrained effect should be an ordered factor.
data frame containing the variables in the model.
optional vector of group levels for residual variances. Data should be sorted by this value.
optional list containing the constraints. See Details for further information.
function to calculate the test statistic.
function to calculate the test statistic for individual constrats. See Details for further information.
solver to use in isotonization (passed to activeSet
).
logical, whether all pairwise comparisons should be considered (constraints will be ignored).
space for additional arguments.
The output of clme
is an object of the class clme
, which is list with elements:
theta
estimates of \(\theta\) coefficients
theta
estimates of \(\theta_0\) coefficients under the null hypothesis
ssq
estimate of residual variance(s), \(\sigma^{2}_{i}\).
tsq
estimate of random effects variance component(s), \(\tau^{2}_{i}\).
cov.theta
the unconstrained covariance matrix of \(\theta\)
ts.glb
test statistic for the global hypothesis.
ts.ind
test statistics for each of the constraints.
mySolver
the solver used for isotonization.
constraints
list containing the constraints (A
) and the contrast for the global test (B
).
dframe
data frame containing the variables in the model.
residuals
matrix containing residuals. For mixed models three types of residuals are given.
random.effects
estimates of random effects.
gfix
group sample sizes for residual variances.
gran
group sizes for random effect variance components.
gfix_group
group names for residual variances.
formula
the formula used in the model.
call
the function call.
order
list describing the specified or estimated constraints.
P1
the number of constrained parameters.
nsim
the number of bootstrap simulations used for inference.
If any random effects are included, the function computes MINQUE estimates of variance components. After,
clme_em
is run to obtain the observed values. If nsim
>0, a bootstrap test is performed
using resid_boot
.
For the argument levels
the first list element should be the column index (in data
) of the
constrained effect. The second element should be the true order of the levels.
Jelsema, C. M. and Peddada, S. D. (2016). CLME: An R Package for Linear Mixed Effects Models under Inequality Constraints. Journal of Statistical Software, 75(1), 1-32. doi:10.18637/jss.v075.i01
# NOT RUN {
data( rat.blood )
cons <- list(order="simple", decreasing=FALSE, node=1 )
clme.out <- clme(mcv ~ time + temp + sex + (1|id), data=rat.blood ,
constraints=cons, seed=42, nsim=10 )
# }
Run the code above in your browser using DataLab