Learn R Programming

dpm (version 1.2.0)

update: Various methods for dpm objects

Description

R likes it when these things have documentation.

Usage

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)

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.

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

Examples

Run this code

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))

Run the code above in your browser using DataLab