make_inlamemi_scaling_vector {inlamemi}R Documentation

Construct scaling vector to scale the precision of correctly observed observations

Description

Construct scaling vector to scale the precision of correctly observed observations

Usage

make_inlamemi_scaling_vector(
  inlamemi_stack,
  error_type,
  classical_error_scaling = NULL,
  vars
)

Arguments

inlamemi_stack

an object of class inlamemi.data.stack containing data structured

error_type

type of error (one or more of "classical", "berkson", "missing")

classical_error_scaling

can be specified if the classical measurement error varies across observations. Must be a vector of the same length as the data.

vars

Results from a call to "extract_variables_from_formula" function. If this is not passed as an argument, it is called inside the function.

Value

A vector reflecting the scaling factor for the residual terms in each model level.

Examples


stacks <- make_inlamemi_stacks(data = simple_data,
                             formula_moi = y ~ x + z,
                             formula_imp = x ~ z,
                             error_type = c("classical", "berkson"))
vars <- extract_variables_from_formula(formula_moi = y ~ x + z,
                                       formula_imp = x ~ z)
make_inlamemi_scaling_vector(stacks,
                           error_type = c("classical", "berkson"),
                           vars = vars)


[Package inlamemi version 1.0.0 Index]