Skip to content

BoundsError when running coeftable on real data #13

@Alx-mor

Description

@Alx-mor

Description

Hello!

While extracting coefficients with coeftable(m) from the model with this formula (fLMM = @formula 0 ~ 1 + condition + (1 | subject)), I receive the following error: BoundsError: attempt to access 5-element Vector{String} at index [3-element BitVector].
This error does not occur with the simulated data from the tutorial, only with real data.

I've consulted the documentation and then verified that my data is:

  • An Array Float 64 with shape channel, times, total epochs; namely, 3 channels, 601 times, 158 epochs
  • Events contain ~150 entries across 2 subjects, each with 4 condition levels (fully crossed). The only issue here the number of epochs across subjects and conditions is not fully balanced, as I dropped noisy epochs
  • In events dataframe, the subject and condition columns are both explicitly converted to categorical
  • Model formula is fLMM = @formula 0 ~ 1 + condition + (1 | subject); 1-element Vector{StatsModels.FormulaTerm{StatsModels.InterceptTerm{false}, Tuple{StatsModels.MatrixTerm{Tuple{StatsModels.InterceptTerm{true}, StatsModels.CategoricalTerm{DummyCoding, Matrix{Float64}, 3}}}, RandomEffectsTerm}}}: �[38;2;144;202;249m1�[39m �[38;2;239;83;80m+�[39m condition �[38;2;239;83;80m+�[39m (�[38;2;144;202;249m1�[39m �[38;2;239;83;80m|�[39m subject) (I work in JupyterLab and it seems to be an issue with some julia outputs presentation)
  • Type of condition is CategoricalVector{String7, UInt32, String7, CategoricalValue{String7, UInt32}, Union{}} (alias for CategoricalArray{String7, 1, UInt32, String7, CategoricalValue{String7, UInt32}, Union{}})
  • Condition is a 4-element Vector{String7}: "a_cr", "b_cr", "b_ncr", "a_ncr"
  • The model fits with no issues (m = fit(UnfoldModel, fLMM, events, data, times))

I also ruled out that formulas with only a fixed effect and only a random effect (fLMM = @formula 0 ~ 1 + condition and fLMM = @formula 0 ~ 1 + (1 | subject), respectively) produce no issue with the coeftable.

Also, I were able to extract coefficients using coef(m) function, and it had a size of 3x601x4 and a length of 7212. But while accessing random effects with ranef(m), I once again got BoundsError: attempt to access 5-element Vector{String} at index [3-element BitVector].

I will be grateful for any guidance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions