f_fit_di {drugDemand}R Documentation

Model Fitting for Dispensed Doses

Description

Fits a linear mixed-effects model to the dispensed doses at drug dispensing visits.

Usage

f_fit_di(df, model, nreps, showplot = TRUE)

Arguments

df

The subject-level dosing data, including usubjid, day, kit, and dose.

model

The model used to analyze the dispensed doses, with options including "constant", "linear model", and "linear mixed-effects model".

nreps

The number of simulations for drawing posterior model parameters.

showplot

A Boolean variable that controls whether or not to show the fitted dose bar chart. It defaults to TRUE.

Value

A list with three components:

Author(s)

Kaifeng Lu, kaifenglu@gmail.com

Examples

library(dplyr)

observed <- f_dose_observed(df2, visitview2, showplot = FALSE)
vf <- observed$vf

vf1 <- vf %>% filter(kit == 3)
di_fit <- f_fit_di(vf1, model = "linear mixed-effects model", nreps = 200)


[Package drugDemand version 0.1.3 Index]