offset_values_extract: Extracts Offset Values

View source: R/offset_values_extract.R

offset_values_extractR Documentation

Extracts Offset Values

Description

Extracts offset values by applying a formula with an offset term to a data frame.

Usage

offset_values_extract(formula, data)

Arguments

formula

An R Formula

data

Data frame

Value

Vector containing offset values

See Also

stats::offset, stats::model.offset

Examples

#############################################################################
# EXAMPLE 1: Toy example for extraction of offset values
#############################################################################

data(data.ma01, package="miceadds")
dat <- data.ma01

dat1 <- mdmb::offset_values_extract( formula=~ migrant + offset(books), data=dat )
dat1[1:5]
  ##  [1] 6 6 5 2 6

alexanderrobitzsch/mdmb documentation built on July 18, 2024, 11:14 p.m.