Fit a generalized linear model with the cluster bootstrap for analysis of clustered data.
clusbootglm(
model,
data,
clusterid,
family = gaussian,
B = 5000,
confint.level = 0.95,
n.cores = 1
)
generalized linear model to be fitted with the cluster bootstrap. This should either be a formula (or be able to be interpreted as one) or a glm
/ lm
object. From the (g)lm
objects, the formula will be used.
dataframe that contains the data.
variable in data that identifies the clusters.
error distribution to be used in the model, e.g. gaussian
or binomial
.
number of bootstrap samples.
level of confidence interval.
number of CPU cores to be used.
clusbootglm
produces an object of class "clusbootglm"
, containing the following relevant components:
A matrix of B
rows, containing the parameter estimates for all bootstrap samples.
n*B matrix, of which each column represents a bootstrap sample; each value in a column represents
a unit of subjectid
.
Parameter estimates from a single (generalized) linear model.
Mean values of the paramater estimates, derived from the bootstrap coefficients.
Standard deviations of cluster bootstrap parameter estimates.
User defined confidence interval level.
Confidence interval based on percentiles, given the user defined confidence interval level.
Confidence interval based on lm.coefs
and column standard deviations of coefficients
,
given the user defined confidence interval level.
Confidence interval based on percentiles with bias correction and acceleration, given the user defined confidence interval level.
Cluster bootstrap sample numbers with at least one coefficient being NA
.
For each of the coefficients, the number of failed bootstrap samples are given.
Some useful methods for the obtained clusbootglm
class object are summary.clusbootglm
,
coef.clusbootglm
, and clusbootsample
.
# NOT RUN {
data(opposites)
clusbootglm(SCORE~Time*COG,data=opposites,clusterid=Subject)
# }
Run the code above in your browser using DataLab