| Type: | Package |
| Title: | A Package for BInary Longitudinal Data |
| Version: | 1.3-0 |
| Date: | 2026-10-14 |
| Description: | Performs logistic regression for binary longitudinal data, allowing for serial dependence among observations from a given individual and a random intercept term. Estimation is via maximization of the exact likelihood of a suitably defined model. Missing values and unbalanced data are allowed, with some restrictions. M. Helena Goncalves et al. (2012) <doi:10.18637/jss.v046.i09>. |
| Encoding: | UTF-8 |
| NeedsCompilation: | yes |
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| LazyData: | true |
| Depends: | R (≥ 3.1.0), stats, graphics, grDevices, utils, methods |
| Imports: | ggplot2, tibble, generics |
| Suggests: | patchwork |
| Config/roxygen2/version: | 8.0.0 |
| RoxygenNote: | 7.3.3 |
| Collate: | 'autoplot.bild.R' 'bild_main.R' 'classes_and_generics.R' 'data.R' 'gradlogL_bin0.R' 'gradlogL_bin0I.R' 'gradlogL_bin1.R' 'gradlogL_bin1I.R' 'gradlogL_bin2.R' 'gradlogL_bin2I.R' 'logL_bin0.R' 'logL_bin0I.R' 'logL_bin0I_aux.R' 'logL_bin0_aux.R' 'logL_bin1.R' 'logL_bin1I.R' 'logL_bin1I_aux.R' 'logL_bin1_aux.R' 'logL_bin2.R' 'logL_bin2I.R' 'logL_bin2I_aux.R' 'logL_bin2_aux.R' 'methods_complex.R' 'methods_getters.R' 'num_InfoI.R' 'num_info.R' 'plot_bild_missing.R' 'predict.bild.R' 'zzz.R' |
| Packaged: | 2026-10-14 17:17:06 UTC; PC |
| Author: | M. Helena Goncalves
|
| Maintainer: | M. Helena Goncalves <mhgoncal@ualg.pt> |
| Repository: | CRAN |
| Date/Publication: | 2026-10-14 18:12:07 UTC |
bild: A Package for BInary Longitudinal Data
Description
Performs logistic regression for binary longitudinal data, allowing for serial dependence among observations from a given individual and a random intercept term. Estimation is via maximization of the exact likelihood of a suitably defined model. Missing values and unbalanced data are allowed, with some restrictions. M. Helena Goncalves et al. (2012) doi: 10.18637/jss.v046.i09.
Author(s)
Maintainer: M. Helena Goncalves mhgoncal@ualg.pt (ORCID)
Authors:
M. Salome Cabral
Adelchi Azzalini
Other contributors:
R. Piessens (Author of Fortran-77 subroutines from Quadpack) [contributor]
E. de Doncker (Author of Fortran-77 subroutines from Quadpack) [contributor]
Airpollution dataset
Description
This example is a subset of data from the Six Cities study, a longitudinal study of the health effects of air pollution (Ware, J. H. et al., 1984).
Usage
airpollution
Format
A data frame with 128 observations on the following 5 variables:
ididentifies the number of the individual profile, containing 32 individual profiles.
wheezea numeric vector that identifies the wheezing status (1="yes", 0="no").
agea numeric vector corresponding to the age in years since the child's 9th birthday.
smokinga factor that identifies if the mother smokes (1="smoke", 0="no smoke").
countsa numeric vector corresponding to the replications of each individual profile.
Details
The data set presented by Fitzmaurice and Laird (1993) contains complete records on 537 children from Steubenville, Ohio. The repeated binary response is the wheezing status of a child. Maternal smoking status was determined in the first interview and treated as a time-independent covariate.
Source
Fitzmaurice, G. M. and Laird, N. M. (1993). A Likelihood-Based Method for analyzing Longitudinal Binary Response. Biometrika, 80, 141-51.
Examples
data(airpollution)
str(airpollution)
# Dependence="MC2"
air2 <- bild(wheeze~age+smoking, data=airpollution, time="age",
aggregate=smoking, dependence="MC2")
summary(air2)
getAIC(air2)
getLogLik(air2)
# Base graphics diagnostics
plot(air2)
# ggplot2-based diagnostics
library(ggplot2)
autoplot(air2, which = 1) # Residuals vs Fitted values
autoplot(air2, which = 2) # Standardized Residuals vs Time
autoplot(air2, which = 5) # Estimated Parametric Profiles
# Multi-panel diagnostic plots using patchwork
library(patchwork)
(autoplot(air2, which = 5) + autoplot(air2, which = 2)) /
(autoplot(air2, which = 1) + autoplot(air2, which = 3))
# Dependence="MC2R"
air2r <- bild(wheeze~age+smoking, data=airpollution, time="age",
aggregate=smoking, dependence="MC2R")
summary(air2r)
# Compare base plot with autoplot for individual profiles
plot(air2r, which=6, subSET=smoking=="0", main="smoking==0", ident=TRUE)
autoplot(air2r, which=6, subSET=smoking=="0", ident=TRUE)
Analysis of Deviance for 'bild' objects
Description
Computes an analysis of deviance table for two or more fitted model
objects of class bild.
Usage
## S4 method for signature 'bild'
anova(object, ..., test = TRUE, correct = FALSE)
Arguments
object |
An object of class |
... |
Additional objects of class |
test |
Logical. If TRUE, the likelihood ratio test is performed. Default is TRUE. |
correct |
Logical. If TRUE, a correction for the likelihood ratio test is applied (e.g., for mixture models). Default is FALSE. |
Details
Setting correct = TRUE is used to test the presence of a random intercept term;
the solution proposed by Self and Liang (1987) is adopted for the p-value.
Note
The comparison between two models by anova will only be valid if they
are fitted to the same dataset.
References
Self, Steven G. and Liang, Kung-Yee (1987). Asymptotic properties of maximum likelihood estimators and likelihood ratio tests under nonstandard conditions. Journal of the American Statistical Association, 82, 605-610.
Examples
data(locust)
loc1 <- bild::bild(move~(time+I(time^2))*feed*sex, data=locust, dependence="MC1")
loc2 <- bild::bild(move~(time+I(time^2))*feed, data=locust, dependence="MC1")
anova(loc1, loc2)
data(muscatine)
muscatine$time1 <- c(-1, 0, 1)
musc1 <- bild::bild(obese~time1, data=muscatine, time="time1", dependence="MC1")
musc1r <- bild::bild(obese~time1, data=muscatine, time="time1", dependence="MC1R")
anova(musc1, musc1r, correct=TRUE)
Autoplot Method for bild Objects using ggplot2
Description
Generates ggplot2-based diagnostic and profile plots for a fitted
bild longitudinal model object.
Usage
## S3 method for class 'bild'
autoplot(object, which = 5, add.unadjusted = FALSE, subSET, ident = FALSE, ...)
Arguments
object |
A fitted model object of class |
which |
A numeric value from 1 to 6 specifying the plot type. |
add.unadjusted |
Logical. |
subSET |
An optional logical expression to subset individuals in plot 6. |
ident |
Logical. |
... |
Further arguments passed. |
Value
A ggplot object.
Examples
library(ggplot2)
library(patchwork)
library(bild)
data(airpollution)
air1R <- bild::bild(wheeze ~ age + smoking, data = airpollution, time = "age",
aggregate = smoking, dependence = "MC1R")
# Single diagnostic plot (Standardized Residuals vs Time)
autoplot(air1R, which = 2)
# Multi-panel diagnostic plots using patchwork
(autoplot(air1R, which = 5) + autoplot(air1R, which = 2)) /
(autoplot(air1R, which = 1) + autoplot(air1R, which = 3))
# Individual mean profiles for the smoker group
autoplot(air1R, which = 6, subSET = smoking == "1", ident = TRUE)
Fit of Parametric Models for Binary Longitudinal Data via Likelihood Method
Description
Performs the fit of parametric models via likelihood method. Serial dependence and random intercept are allowed according to the stochastic model chosen. Missing values and unbalanced data are automatically accounted for computing the likelihood function.
Usage
bild(
formula = formula(data),
data,
time,
id,
subSET,
aggregate = FALSE,
start = NULL,
trace = FALSE,
dependence = "ind",
method = "BFGS",
control = bildControl(),
integrate = bildIntegrate()
)
Arguments
formula |
a description of the model to be fitted of the form |
data |
a data frame containing the variables in the formula. |
time |
a string that matches the name of the |
id |
a string that matches the name of the |
subSET |
an optional expression indicating a subset of the rows of |
aggregate |
a string that permits the user to identify the factor to be used in |
start |
a vector of initial values for the nuisance parameters. |
trace |
logical; if TRUE, details of the nonlinear optimization are printed. |
dependence |
a character string stating which dependence structure to use: "ind", "MC1", "MC2", "indR", "MC1R", "MC2R". Default is "ind". |
method |
the optimization method used by |
control |
a list of control parameters for |
integrate |
a list of algorithmic constants for numerical integration (Fortran-77/QUADPACK). |
Details
The underlying methodology builds a logistic regression model for the probability that the response variable takes value 1 as a function of the covariates, taking into account that successive observations from the same individual cannot be assumed to be independent.
Value
An object of class bild.
References
Azzalini, A. (1994). Logistic regression for autocorrelated data with application to repeated measures. Biometrika, 81, 767-775. Goncalves, M. H., Cabral, M. S., and Azzalini, A. (2012). The R Package bild for the Analysis of Binary Longitudinal Data. Journal of Statistical Software, 46(9), 1-17.
Examples
# Example with airpollution data
data(airpollution)
air2r <- bild(wheeze~age+smoking, data=airpollution, trace=TRUE,
time="age", aggregate=smoking, dependence="MC2R")
summary(air2r)
Class "bild" for Results of a Maximum Likelihood Estimation
Description
This class encapsulates results of a maximum likelihood procedure
and is usually created as the result of a call to bild.
Slots
coefficientsMatrix. Estimated parameters.
seMatrix. Standard errors of estimated parameters.
covarianceMatrix. Covariance of estimated parameters.
correlationMatrix. Correlation of estimated parameters.
log.likelihoodNumeric. The value of the log likelihood.
messageInteger. Information returned by the optimizer.
n.casesNumeric. Number of individual profiles used in the optimization.
ni.casesNumeric. Number of individual profiles in the dataset.
aicNumeric. The Akaike information criterion.
residualsNumeric. The residuals of estimated parameters.
s.residualsNumeric. The residuals summed over the individual profile.
ind.probabilityNumeric. The transition probabilities.
prob.matrixMatrix. The matrix of transition probabilities.
FittedNumeric. The fitted values for the estimated parameters.
bi.estimateMatrix. The estimated values for the individual random effects.
Fitted.avNumeric. The average fitted values.
TimeNumeric. Vector of time points.
model.matrixMatrix. The model matrix.
y.matrixMatrix. The matrix of response values.
subset.dataData.frame. The data subset if considered.
y.avNumeric. The average of the response value over an individual profile.
f.valueFactor. Indicates the aggregation factor if present.
callLanguage. The call to
"bild".
See Also
Auxiliary for Controlling "bild" Fitting
Description
Auxiliary function as user interface for bild fitting.
Usage
bildControl(maxit = 100, abstol = 1e-06, reltol = 1e-06)
Arguments
maxit |
maximum number of iterations. |
abstol |
absolute convergence tolerance. |
reltol |
relative convergence tolerance. |
Details
See R documentation of optim for details of standard default values
for the remaining options not considered in bildControl.
Value
A list with the arguments as components.
See Also
Auxiliary for Controlling "bild" Fitting
Description
Auxiliary function as user interface for bild fitting to set
integration constants used in numerical integration.
Usage
bildIntegrate(
li = -4,
ls = 4,
epsabs = .Machine$double.eps^0.25,
epsrel = .Machine$double.eps^0.25,
limit = 100,
key = 6,
lig = -4,
lsg = 4
)
Arguments
li |
lower limit of integration for the log-likelihood. |
ls |
upper limit of integration for the log-likelihood. |
epsabs |
absolute accuracy requested. |
epsrel |
relative accuracy requested. |
limit |
integer that gives an upperbound on the number of subintervals. |
key |
integer from 1 to 6 for choice of local integration rule (Gauss-Kronrod). |
lig |
lower limit of integration for the gradient. |
lsg |
upper limit of integration for the gradient. |
Details
bildIntegrate returns a list of constants used to compute integrals based on
a Fortran-77 subroutine dqage from the QUADPACK package.
The numerical integration is performed over the interval (li * \sigma, ls * \sigma),
where \sigma = \exp(\omega)/2. If integration produces errors or NaNs in the information
matrix, users should adjust li, ls, lig, or lsg.
For datasets with a high number of time points (> 30), it is recommended to set integration limits to smaller values than the default.
Value
A list with the arguments as components.
See Also
Examples
library(bild)
data(locust)
# Example using locust data
Integ <- bildIntegrate(li = -2.5, ls = 2.5, lig = -2.5, lsg = 2.5)
locust2r_feed1 <- bild(move ~ (time + I(time^2)) * sex, data = locust,
subSET = feed == "1", aggregate = sex,
dependence = "MC2R", integrate = Integ)
Fitted values for 'bild' objects
Description
Fitted values for 'bild' objects
Usage
## S4 method for signature 'bild'
fitted(object, ...)
Arguments
object |
an object of class |
... |
Additional arguments. |
Value
A numeric vector of the fitted values.
See Also
Extract fixed effects estimates
Description
Extract fixed effects estimates
Usage
## S4 method for signature 'bild'
fixeff(object)
Arguments
object |
an object of class |
Value
A matrix or vector containing the fixed effects estimates.
See Also
Extract the Akaike Information Criterion
Description
Extract the Akaike Information Criterion
Usage
## S4 method for signature 'bild'
getAIC(object)
Arguments
object |
an object of class |
Value
Returns a numeric value corresponding to the AIC of the fitted model.
See Also
Extract Log-Likelihood
Description
Extract Log-Likelihood
Usage
## S4 method for signature 'bild'
getLogLik(object)
Arguments
object |
an object of class |
Value
Returns a numeric value corresponding to the log-Likelihood of the fitted model.
See Also
Extract variance estimates of random effects
Description
These functions extract the variance estimate of the random effect (\sigma^2 = \exp(\omega))
from an object of class bild.
Usage
## S4 method for signature 'bild'
getVariance(object, se = FALSE)
Arguments
object |
an object of class |
se |
logical; if |
Value
A data frame containing the variance estimate.
Extract the coefficient estimates
Description
Extract the coefficient estimates
Usage
## S4 method for signature 'bild'
getcoef(object)
Arguments
object |
an object of class |
Value
Returns the coefficient estimates of the fitted model (a matrix).
See Also
Extract variance-covariance matrix
Description
Extract variance-covariance matrix
Usage
## S4 method for signature 'bild'
getvcov(object)
Arguments
object |
an object of class |
Value
Returns a numeric matrix corresponding to the variance-covariance matrix of the fitted model.
See Also
Glance at a bild object
Description
Glance at a fitted longitudinal model object of class bild
to extract a single-row summary tibble with key statistics.
Usage
## S3 method for class 'bild'
glance(x, ...)
Arguments
x |
A fitted model object of class |
... |
Additional arguments. Not used. |
Value
A tibble::tibble with summary statistics (number of observations,
degrees of freedom/parameters, log-likelihood, AIC, and BIC).
Examples
library(bild)
library(generics)
data(airpollution)
air1R <- bild::bild(wheeze ~ age + smoking, data = airpollution, time = "age",
aggregate = smoking, dependence = "MC1R")
glance(air1R)
Locust dataset
Description
This data set was presented by MacDonald and Raubenheimer (1995) and analyzes the effect of hunger on locomotory behaviour of 24 locusts (Locusta migratoria) observed at 161 time points.
Usage
locust
Format
A data frame with 3864 observations on the following 5 variables:
ida numeric vector that identifies the number of the individual profile.
movea numeric vector representing the response variable (1="moving", 0="not moving").
sexa factor with levels 1 for "male" and 0 for "female".
timea numeric vector that identifies the number of the time points observed.
feeda factor with levels 0 "no" and 1 "yes".
Source
MacDonald, I. and Raubenheimer, D. (1995). Hidden Markov models and animal behaviour. Biometrical Journal, 37, 701-712.
Examples
data(locust)
str(locust)
# Dependence="MC2" (Fast computation)
locust2_feed1 <- bild(move ~ (time + I(time^2)) * sex, data = locust,
subSET = feed == "1", aggregate = sex, dependence = "MC2")
summary(locust2_feed1)
# Base plot diagnostics (Standard)
plot(locust2_feed1, which = 5, ylab = "probability of locomoting",
main = "Feed=1", add.unadjusted = TRUE)
# ggplot2-based diagnostic plots (New)
library(ggplot2)
# Comparing which=5 with the base plot above
autoplot(locust2_feed1, which = 5)
# Other diagnostic plots
autoplot(locust2_feed1, which = 1)
autoplot(locust2_feed1, which = 2)
Extract the fixed effects model matrix
Description
Extract the fixed effects model matrix
Usage
## S4 method for signature 'bild'
model.mat(object)
Arguments
object |
an object of class |
Value
Returns the fixed effects model matrix of the fitted model.
See Also
Muscatine dataset
Description
This example is a subset of data from the Muscatine Coronary Risk Factor Study, a longitudinal study of coronary risk factors in school children from Muscatine (Iowa, USA).
Usage
muscatine
Format
A data frame with 156 observations on the following 5 variables:
ididentifies the number of the individual profile.
obesea numeric vector that identifies the obesity status (1="yes", 0="no").
sexa factor with levels 1 for "female" and 0 for "male".
timea numeric vector (1,2,3) indicating the observed time points.
countsa numeric vector indicating the number of times that each profile is replicated.
Source
Fitzmaurice, G. M., Laird, N. M. and Lipsitz, S. R. (1994). Analyzing incomplete longitudinal binary responses: a likelihood based approach. Biometrics, 38, 602-612.
Examples
data(muscatine)
str(muscatine)
# we decompose the time effect in orthogonal components
muscatine$time1 <- c(-1, 0, 1)
muscatine$time2 <- c(1, -2, 1)
# second order Markov Chain without random effects
musc2 <- bild(obese~(time1+time2)*sex, data=muscatine,
time="time1", aggregate=sex, trace=TRUE, dependence="MC2")
summary(musc2)
getAIC(musc2)
getLogLik(musc2)
fitted(musc2)
Plot Diagnostics for 'bild' Objects (Base Graphics)
Description
Diagnostic and profile plots for a fitted bild
longitudinal model object using standard R base graphics. Six plots
(selectable by which) are currently available. By default,
the first five are provided.
Usage
## S4 method for signature 'bild,missing'
plot(
x,
y,
which = c(1:5),
ylab = NULL,
main = NULL,
ask = prod(par("mfcol")) < length(which) && dev.interactive(),
subSET,
add.unadjusted = FALSE,
ident = FALSE,
caption = c("Residuals vs Fitted", "Residuals vs Time", "ACF residuals",
"PACF residuals", "Individual mean profiles"),
cex.caption = 1
)
Arguments
x |
An object of class |
y |
Not used. Must be missing. |
which |
If a subset of the plots is required, specify a subset of the numbers 1:6:
|
ylab |
Label to some plots ( |
main |
Title to some plots in addition to the caption ( |
ask |
Logical expression; if |
subSET |
Logical expression indicating elements to keep in individual mean
profile plots: missing values are taken as |
add.unadjusted |
Logical expression indicating whether or not to add
the unadjusted fit for plot in |
ident |
Logical expression indicating whether or not to add the number
of the subject to individual mean profile plots. The |
caption |
Captions to appear above the plots. Defaults to a vector of standard labels. |
cex.caption |
Controls the font size expansion factor for the caption. |
Details
The option which=5 provides the parametric fitted model if the dependence
structure is "ind" (independence), "MC1" (first order Markov Chain) or "MC2"
(second order Markov Chain).
When the dependence structure is "indR" (independence with random intercept),
"MC1R" (first order Markov Chain with random intercept) or "MC2R" (second order
Markov Chain with random intercept), the parametric adjusted fit is provided and
the user can set add.unadjusted=TRUE to provide the unadjusted fitted curves.
The option which=6 is used only if the random intercept is present (models
ending in "R") and provides the individual mean profile plots.
Value
No return value, called for side effects (generating plots).
Methods
signature(x="ANY", y="ANY")Generic function.
signature(x="bild", y="missing")Plot diagnostics for
bildobject.
Examples
library(bild)
data(locust)
# It takes a very long time to run
str(locust)
# dependence="MC2R"
Integ <- bild::bildIntegrate(li=-2.5, ls=2.5, lig=-2.5, lsg=2.5)
locust2r_feed1 <- bild::bild(move~(time+I(time^2))*sex, data=locust,
subSET=feed=="1", aggregate=sex, dependence="MC2R",
integrate=Integ)
summary(locust2r_feed1)
plot(locust2r_feed1, which=5, ylab="probability of locomoting",
add.unadjusted=TRUE)
plot(locust2r_feed1, which=6, subSET=sex=="1",
main="sex==1 & Feed=1", ident=TRUE)
locust2r <- bild::bild(move~(time+I(time^2))*feed, data=locust,
trace=TRUE, aggregate=feed, dependence="MC2R",
integrate=Integ)
par(mfrow=c(2,2))
plot(locust2r, which=1)
plot(locust2r, which=2)
plot(locust2r, which=3)
plot(locust2r, which=4)
par(mfrow=c(1,1))
plot(locust2r, which=5, ylab="probability of locomoting",
main="Feed & Unfeed groups", add.unadjusted=TRUE)
plot(locust2r, which=6, ylab="probability of locomoting",
main="Fed & Unfed groups", ident=TRUE)
Predict Method for bild Objects
Description
Obtains predictions (link, response, or dynamic transition probabilities)
from a fitted bild model object for existing or new data structures.
Usage
## S3 method for class 'bild'
predict(
object,
newdata = NULL,
type = c("link", "response", "transition"),
...
)
Arguments
object |
A fitted model object of class |
newdata |
Optionally, a data frame in which to look for variables with which to predict. If omitted, the fitted linear predictors or probabilities from the original fit are returned. |
type |
The type of prediction required. Use |
... |
Additional arguments passed to or from other methods. |
Value
A numeric vector of predicted values or probabilities matching the data rows.
See Also
Examples
library(bild)
# First-order Markov dependence (MC1)
data(airpollution)
air1 <- bild(wheeze ~ age + smoking, data = airpollution,
time = "age", aggregate = smoking, dependence = "MC1")
# Standard marginal response prediction on original data
pred_mar <- predict(air1, type = "response")
head(pred_mar)
# Dynamic transition probabilities on new data (requires y_prev1)
new_data_air <- data.frame(
age = c(9, 10, 11, 9, 10, 11),
smoking = factor(c("0", "0", "0", "1", "1", "1")),
y_prev1 = c(0, 1, 0, 1, 1, 0))
dynamic_pred_air <- predict(air1, newdata = new_data_air, type = "transition")
print(cbind(new_data_air, Prob_Transition = dynamic_pred_air))
# Second-order Markov with random effects (MC2R)
data(muscatine)
muscatine$time1 <- c(-1, 0, 1)
muscatine$time2 <- c(1, -2, 1)
Integ <- bildIntegrate(lig = -3.95, lsg = 3.95)
musc2r <- bild(obese ~ (time1 + time2) * sex, data = muscatine,
time = "time1", start = c(1, 1, 1), dependence = "MC2R", integrate = Integ)
# Dynamic transition probabilities for second-order model (requires y_prev1 and y_prev2)
new_data_musc <- data.frame(
time1 = c(0, 1),
time2 = c(-2, 1),
sex = factor(c("0", "1")),
y_prev1 = c(1, 0),
y_prev2 = c(0, 1))
dynamic_pred_musc <- predict(musc2r, newdata = new_data_musc, type = "transition")
print(cbind(new_data_musc, Prob_Transition = dynamic_pred_musc))
Extract conditional random effects
Description
Extract conditional random effects
Usage
## S4 method for signature 'bild'
randeff(object)
Arguments
object |
an object of class |
Value
A data frame containing the random effects estimates, if the model contains random effects. Otherwise, it issues a warning.
See Also
Show a 'bild' object
Description
show displays a brief summary of a fitted bild
model object, including the function call, the number of profiles used
in the fit, the number of estimated coefficients, the maximized log-likelihood,
and any convergence message.
Usage
## S4 method for signature 'bild'
show(object)
Arguments
object |
An object of class |
Value
No return value, called for side effects (printing to the console).
See Also
Summary of a 'bild' object
Description
Summary method for class bild. Computes and prints
summary statistics for a fitted bild object.
Usage
## S4 method for signature 'bild'
summary(object, cov = FALSE, cor = FALSE)
Arguments
object |
an object of class |
cov |
logical. If TRUE, prints the covariance matrix of coefficients. |
cor |
logical. If TRUE, prints the correlation matrix of coefficients. |
Value
Returns the summary object (invisibly).
See Also
Class "summary.bild"
Description
Summary of bild objects. Extracted from a bild object,
it contains values meant for printing by the show method.
Slots
coefficientsMatrix. Estimated parameters.
seMatrix. Standard errors of estimated parameters.
covarianceMatrix. Covariance of estimated parameters.
correlationMatrix. Correlation of estimated parameters.
log.likelihoodNumeric. The value of the log likelihood.
messageInteger. Information returned by the optimizer.
n.casesNumeric. Number of individual profiles used in the optimization procedure.
ni.casesNumeric. Number of individual profiles in the dataset.
aicNumeric. The Akaike information criterion.
callLanguage. The call that generated the
bildobject.
See Also
Tidy a bild object into a tibble
Description
Tidy a bild object into a tibble
Usage
## S3 method for class 'bild'
tidy(x, conf.int = FALSE, conf.level = 0.95, ...)
Arguments
x |
A fitted model object of class |
conf.int |
Logical. Whether or not to include a confidence interval
in the tidied output. Defaults to |
conf.level |
The confidence level to use for the confidence interval
if |
... |
Additional arguments. Not used. |
Details
For parameters estimated on the log-scale (such as dependence parameters
log.psi1, log.psi2) and the random effect variance parameter
omega, tidy.bild automatically transforms the estimates to their
natural scale (psi1, psi2, sigma2) via the exponential
function. Consequently, their standard errors are adjusted using the Delta method,
and confidence intervals are computed accordingly.
Value
A tibble::tibble containing columns: term, estimate, std.error,
statistic, p.value, conf.low, conf.high.
Examples
library(bild)
library(generics)
data(airpollution)
air1R <- bild::bild(wheeze ~ age + smoking, data = airpollution, time = "age",
aggregate = smoking, dependence = "MC1R")
tidy(air1R, conf.int = TRUE)
Extract variance estimates of random effects (wrapper)
Description
Extract variance estimates of random effects (wrapper)
Usage
## S4 method for signature 'bild'
vareff(object)
Arguments
object |
an object of class |
Value
A data frame containing the variance estimate.