Create a Blank COPE / Contrast Matrix from a Model or Predictor Names
Source:R/gen_contrast_blank.R
gen_contrast_blank.RdCreate a Blank COPE / Contrast Matrix from a Model or Predictor Names
See also
Other contrast or COPE helpers:
check_contrast_orthogonality(),
gen_contrast_ss(),
gen_data_jn(),
plot.jn_df(),
tidy_es_cope_F(),
tidy_es_cope_t()
Examples
fit <- lm(salary ~ rank + yrs.since.phd, data = carData::Salaries)
gen_contrast_blank(fit, contrasts = 2)
#> (Intercept) rankAssocProf rankProf yrs.since.phd
#> [1,] 0 0 0 0
#> [2,] 0 0 0 0
gen_contrast_blank(fit, contrasts = c("ContrastA", "ContrastB"))
#> (Intercept) rankAssocProf rankProf yrs.since.phd
#> ContrastA 0 0 0 0
#> ContrastB 0 0 0 0