Build a group-level (between-subject) design matrix

dcm_peb_design(n_subj, covariates = NULL, Xnames = NULL)

Arguments

n_subj

Number of subjects (rows).

covariates

Optional data frame of between-subject covariates with n_subj rows. NULL gives an intercept-only design.

Xnames

Optional character vector of column names for the design.

Value

A numeric design matrix with n_subj rows.

Examples

# Intercept only: tests the group mean
dcm_peb_design(4)
#>      Intercept
#> [1,]         1
#> [2,]         1
#> [3,]         1
#> [4,]         1

# With a between-subject covariate
dcm_peb_design(4, covariates = data.frame(age = c(21, 34, 46, 58)))
#>   (Intercept) age
#> 1           1  21
#> 2           1  34
#> 3           1  46
#> 4           1  58
#> attr(,"assign")
#> [1] 0 1