Code Monkey home page Code Monkey logo

Comments (4)

PharmCat avatar PharmCat commented on May 27, 2024

Removing the nested term lets me specify the formula
BoundsError: attempt to access 20683×1109 Matrix{Float64} at index

Hi! It seems that your data have missing values. The last version of Metida does not work with missing data yet. Try to filter your data and try without missing values.

from metida.jl.

PharmCat avatar PharmCat commented on May 27, 2024

This is the full model I want to specify

"/" syntax not implemented yet. You can use 2 random factors for this: (1 | Subject ) + (1 | Subject & Protein)

You can see that it equal:
MixedModels

julia> fm4a = fit(MixedModel, @formula(strength ~ 1 + (1|batch/cask)), pastes, REML = true)
Linear mixed model fit by REML
 strength ~ 1 + (1 | batch) + (1 | batch & cask)
 REML criterion at convergence: 246.99074585344238

Variance components:
                Column   Variance Std.Dev.
batch & cask (Intercept)  8.433665 2.904077
batch        (Intercept)  1.657311 1.287366
Residual                  0.678000 0.823408
 Number of obs: 60; levels of grouping factors: 30, 10

  Fixed-effects parameters:
─────────────────────────────────────────────────
               Coef.  Std. Error      z  Pr(>|z|)
─────────────────────────────────────────────────
(Intercept)  60.0533     0.67687  88.72    <1e-99
─────────────────────────────────────────────────

Metida

lmm = Metida.LMM(@formula(strength~1), pastes;
           random = [Metida.VarEffect(Metida.@covstr(1|batch), Metida.SI),
           Metida.VarEffect(Metida.@covstr(1|batch&cask), Metida.SI)]
           )
  Metida.fit!(lmm)
Linear Mixed Model: strength ~ 1
Random 1: 
    Model: 1|batch
    Type: SI (1), Subjects: 10
Random 2: 
    Model: 1|batch & cask
    Type: SI (1), Subjects: 30
Repeated:
    Model: 1|1
    Type: SI (1)
    Blocks: 10, Maximum block size: 6
Status: converged (No Errors)
    -2 logREML: 246.991    BIC: 259.223

    Fixed-effects parameters:
Name          Estimate   SE        z         Pr(>|z|)   
(Intercept)   60.0533    0.67687   88.7221   0.0

    Variance components:
    θ vector: [1.28736, 2.90408, 0.823408]
Random 1   σ²    var   1.6573
Random 2   σ²    var   8.43368
Residual   σ²    var   0.678001

from metida.jl.

PharmCat avatar PharmCat commented on May 27, 2024

Ultimately I want to obtain pairwise contrasts from my model.

To get estimates you can use estimate(lmm, l::AbstractVector; level = 0.95, name = "Estimate"), this function availabe in version 0.11 on master brunch now, not released yet.

L vector you should make manually.

from metida.jl.

PharmCat avatar PharmCat commented on May 27, 2024

I closed this issue. Don't hesitate to ask any questions. Try version 0.11 :)

from metida.jl.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.