Usage
as.cov_struct(x, ...)
# S3 method for class 'formula'
as.cov_struct(x, warn_partial = TRUE, ...)
Value
A cov_struct()
object.
Details
A covariance structure can be parsed from a model definition formula or call. Generally, covariance structures defined using non-standard evaluation take the following form:
For example, formulas may include terms such as
us(time | subject)
cp(time | group / subject)
sp_exp(coord1, coord2 | group / subject)
Note that only sp_exp
(spatial) covariance structures may provide multiple
coordinates, which identify the Euclidean distance between the time points.
Methods (by class)
-
as.cov_struct(formula)
: When provided a formula, any specialized functions are assumed to be covariance structure definitions and must follow the form:Any component on the right hand side of a formula is considered when searching for a covariance definition.
See also
Other covariance types:
cov_struct()
,
covariance_types
Examples
# provide a covariance structure as a right-sided formula
as.cov_struct(~ csh(visit | group / subject))
#> <covariance structure>
#> heterogeneous compound symmetry:
#>
#> visit | group / subject
#>
# when part of a full formula, suppress warnings using `warn_partial = FALSE`
as.cov_struct(y ~ x + csh(visit | group / subject), warn_partial = FALSE)
#> <covariance structure>
#> heterogeneous compound symmetry:
#>
#> visit | group / subject
#>