Ensures both the child class and the parent schema are satisfied. The validator also back-fills defaults so downstream code can rely on the presence of optional components without defensive checks.
Details
This helper is the single authority on the `nmar_result` schema. It expects
a list that already carries class c(class_name, "nmar_result") and
at least a primary estimate stored in y_hat. All other components are
optional; when they are NULL or missing, the validator supplies safe
defaults:
Core scalars:
se(numeric, defaultNA_real_),estimate_name(character, defaultNA_character_),converged(logical, defaultNA).model: list withcoefficientsandvcov, both defaulting toNULL.weights_info: list withvalues(defaultNULL) andtrimmed_fraction(defaultNA_real_).sample: list withn_total,n_respondents,is_survey, anddesign, defaulted to missing/empty values.inference: list withvariance_method,df, andmessage, all defaulted to missing values.diagnostics,meta, andextra: defaulted to empty lists, withmetacarryingengine_name,call, andformulawhen unset.
Engine constructors should normally call new_nmar_result() rather than
invoking this function directly. new_nmar_result() attaches classes and
funnels all objects through validate_nmar_result() so downstream S3
methods can assume a consistent structure.
