dot-get_spec: (Internal) Locate a 'StudySpecification' in the call stack

.get_specR Documentation

(Internal) Locate a StudySpecification in the call stack

Description

assigned()/ate()/ett()/cov_adj() all need the StudySpecification to operate. If any are called in the model without a specification= argument, this function sees if it can find the StudySpecification in another of these functions.

Usage

.get_spec(NULL_on_error = FALSE)

Arguments

NULL_on_error

if TRUE, returns NULL if a StudySpecification object is not found rather than throwing an error.

Details

Note that it will never look inside assigned() (gets complicated in formulas), only in weights or cov_adj(). E.g.

lm(y ~ assigned(), weights = ate(spec), offest = cov_adj(mod1))

lm(y ~ assigned(), weights = ate(), offest = cov_adj(mod1, specification = spec))

will both work, but

lm(y ~ assigned(spec), weights = ate(), offest = cov_adj(mod1))

will fail.

Value

A StudySpecification, or NULL if NULL_on_error is TRUE and the StudySpecification can't be found.


propertee documentation built on Aug. 22, 2025, 1:09 a.m.