R likes it when these things have documentation.

update(object, ...)

# S3 method for dpm
update(object, formula., ..., evaluate = TRUE)

# S4 method for dpm
update(object, formula., ..., evaluate = TRUE)

# S4 method for dpm
show(object)

coef(object, ...)

# S3 method for dpm
coef(object)

# S4 method for dpm
coef(object)

# S4 method for dpm
formula(x)

Arguments

object

A dpm object

...

Other arguments to update.

formula.

An updated formula (optional)

evaluate

If updating, should the updated model be updated or just return the call? Default is TRUE, re-run the model.

x

A dpm object

Value

update.dpm(): Returns an updated dpm object.

coef.dpm(): Returns a numeric vector of coefficients. If the model was fit with x.free = TRUE and/or y.free = TRUE, the coefficient names will be formatted with an underscore and the wave corresponding to which time period the coefficient is estimated for.

formula.dpm(): Returns the formula used to fit the model as a Formula object. The formula is the input to dpm(), not the lavaan

syntax.

show.dpm(): Returns an invisible "NULL" while printing model info to console.

Examples


data("WageData", package = "panelr")
wages <- panel_data(WageData, id = id, wave = t)
fit <- dpm(wks ~ pre(lag(union)) + lag(lwage), data = wages)

# Re-run model without `lag(lwage)` term
update(fit, . ~ . - lag(lwage))
#> Error in eval(call, parent.frame()): object 'wages' not found