Learn R Programming

vcrpart (version 1.0-7)

olmm-overwritePar: Overwrite coefficients of olmm objects.

Description

Overwrite coefficients of an olmm object and update the likelihood and estimates for random effects.

Usage

olmm_overwritePar(object, coefficients)

Value

An olmm object.

Arguments

object

an olmm object.

coefficients

numeric vector of model coefficients. Must have the same length as object$coefficients and, if provided, the same element names.

Author

Reto Burgin

Details

May be used for simulation studies where parameters are user defined.

See Also

olmm

Examples

Run this code
data(schizo)

model.10.3.1 <-
  olmm(imps79o ~ tx + sqrt(week) + re(1|id),
       data = schizo, family = cumulative())
summary(model.10.3.1)

(newCoef <- coef(model.10.3.1))
newCoef[1:3] <- c(-7, -4, -2) # thresholds
newCoef["tx"] <- 1.5
newCoef["sqrt(week)"] <- 1.6
newCoef[6] <- 2

model.10.3.1.mod <- olmm_overwritePar(object = model.10.3.1, coefficients = newCoef)
summary(model.10.3.1.mod)

Run the code above in your browser using DataLab