make_jlmer_spec {jlmerclusterperm} | R Documentation |
Create a specifications object for fitting regression models in Julia
Description
Create a specifications object for fitting regression models in Julia
Usage
make_jlmer_spec(
formula,
data,
subject = NULL,
trial = NULL,
time = NULL,
drop_terms = NULL,
...
)
Arguments
formula |
Model formula in R syntax |
data |
A data frame |
subject |
Column for subjects in the data. |
trial |
Column for trials in the data. Must uniquely identify a time series within subject (for example, the column for items in a counterbalanced design where each subject sees exactly one item). |
time |
Column for time in the data. |
drop_terms |
(Optional) any terms to drop from the reconstructed model formula |
... |
Unused, for extensibility. |
Value
An object of class jlmer_spec
.
Examples
# Bare specification object (minimal spec for fitting a global model)
spec <- make_jlmer_spec(weight ~ 1 + Diet, ChickWeight)
spec
# Constraints on specification for CPA:
# 1) The combination of `subject`, `trial`, and `time` must uniquely identify rows in the data
# 2) `time` must have constant sampling rate (i.e., evenly spaced values)
spec_wrong <- make_jlmer_spec(
weight ~ 1 + Diet, ChickWeight,
time = "Time"
)
unique(ChickWeight$Time)
# Corrected specification for the above
spec_correct <- make_jlmer_spec(
weight ~ 1 + Diet, subset(ChickWeight, Time <= 20),
subject = "Chick", time = "Time"
)
spec_correct
[Package jlmerclusterperm version 1.1.4 Index]