update.std_selected {stdmod}R Documentation

The 'update' Method for a 'std_selected' Class Object

Description

This should be used only to update the call to lm(), not to the call to std_selected() or std_selected_boot().

Usage

## S3 method for class 'std_selected'
update(object, formula., ..., evaluate = TRUE)

Arguments

object

The output of the class std_selected().

formula.

Changes to the formula.

...

Optional arguments to be changed.

evaluate

Whether the call will be evaluated.

Details

Although supported, it is not recommended to update an analysis processed by std_selected() or std_selected_boot(). It is recommended to call lm() again and pass the output to std_selected() or std_selected_boot().

Value

If evaluate = TRUE, it returns the updated fitted object, otherwise, the updated call.

Author(s)

Shu Fai Cheung https://orcid.org/0000-0002-9871-9448

Examples


# Load a sample data set

dat <- test_x_1_w_1_v_1_cat1_n_500
head(dat)

# Do a moderated regression by lm
lm_raw <- lm(dv ~ iv*mod + v1 + cat1, dat)
summary(lm_raw)

# Standardize all variables except for categorical variables.
# Interaction terms are formed after standardization.
lm_std <- std_selected(lm_raw, to_scale = ~ .,
                               to_center = ~ .)
summary(lm_std)

# Update the model
lm_std2 <- update(lm_std, . ~ . - v1)
summary(lm_std2)


[Package stdmod version 0.2.10 Index]