get_draws_mle {rbmi}R Documentation

Fit the base imputation model on bootstrap samples

Description

Fit the base imputation model using a ML/REML approach on a given number of bootstrap samples as specified by method$n_samples. Returns the parameter estimates from the model fit.

Usage

get_draws_mle(
  longdata,
  method,
  sample_stack,
  n_target_samples,
  first_sample_orig,
  use_samp_ids,
  failure_limit = 0,
  ncores = 1,
  quiet = FALSE
)

Arguments

longdata

R6 longdata object containing all relevant input data information.

method

A method object as generated by either method_approxbayes() or method_condmean() with argument type = "bootstrap".

sample_stack

A stack object containing the subject ids to be used on each mmrm iteration.

n_target_samples

Number of samples needed to be created

first_sample_orig

Logical. If TRUE the function returns method$n_samples + 1 samples where the first sample contains the parameter estimates from the original dataset and method$n_samples samples contain the parameter estimates from bootstrap samples. If FALSE the function returns method$n_samples samples containing the parameter estimates from bootstrap samples.

use_samp_ids

Logical. If TRUE, the sampled subject ids are returned. Otherwise the subject ids from the original dataset are returned. These values are used to tell impute() what subjects should be used to derive the imputed dataset.

failure_limit

Number of failed samples that are allowed before throwing an error

ncores

Number of processes to parallelise the job over

quiet

Logical, If TRUE will suppress printing of progress information that is printed to the console.

Details

This function takes a Stack object which contains multiple lists of patient ids. The function takes this Stack and pulls a set ids and then constructs a dataset just consisting of these patients (i.e. potentially a bootstrap or a jackknife sample).

The function then fits a MMRM model to this dataset to create a sample object. The function repeats this process until n_target_samples have been reached. If more than failure_limit samples fail to converge then the function throws an error.

After reaching the desired number of samples the function generates and returns a draws object.

Value

A draws object which is a named list containing the following:


[Package rbmi version 1.2.6 Index]