Learn R Programming

latrend (version 1.1.0)

latrendBoot: Cluster longitudinal data using bootstrapping

Description

Performs bootstrapping, generating samples from the given data at the id level, fitting a lcModel to each sample.

Usage

latrendBoot(
  method,
  data,
  samples = 50,
  seed = NULL,
  envir = NULL,
  verbose = getOption("latrend.verbose")
)

Arguments

method

The lcMethod object specifying the longitudinal cluster method to apply.

data

A data.frame.

samples

The number of bootstrap samples to evaluate.

seed

The seed to use. Optional.

envir

The environment in which to evaluate the method arguments. Note that this only applies to data when data is a call.

verbose

The level of verbosity. Either an object of class Verbose (see R.utils::Verbose for details), a logical indicating whether to show basic computation information, a numeric indicating the verbosity level (see Verbose), or one of c('info', 'fine', 'finest').

Value

A lcModels object of length samples.

See Also

Other longitudinal cluster fit functions: latrendBatch(), latrendCV(), latrendRep(), latrend()

Other validation methods: createTestDataFolds(), createTestDataFold(), createTrainDataFolds(), latrendCV(), lcModel-data-filters

Examples

Run this code
# NOT RUN {
data(latrendData)
method <- lcMethodKML("Y", id = "Id", time = "Time")
model <- latrendBoot(method, latrendData, samples = 10)
# }

Run the code above in your browser using DataLab