Giter VIP home page Giter VIP logo

Comments (4)

drizopoulos avatar drizopoulos commented on July 18, 2024 1

Great that you found a way to do this.

from glmmadaptive.

drizopoulos avatar drizopoulos commented on July 18, 2024

from glmmadaptive.

shafayetShafee avatar shafayetShafee commented on July 18, 2024

No I actually need the standard errors in the original scale (A bit of context: my professor uses stata and stata shows standard errors, But I am doing the assignment in R and I need to show him the standard error).

Would you please dictate a way to transform the output (that is on log-cholesky scale) to the original scale?

from glmmadaptive.

shafayetShafee avatar shafayetShafee commented on July 18, 2024

Here's a solution to this issue from Cross Validated using delta method to get variance-covariance matrix original scale from the log-cholesky scale.

library("numDeriv")

# estimated covariance matrix of random effects
D <- fm$D

# transform from covariance matrix to entries of cholesky factor with 
# log-transformed main diagonal
D_chol_entries <- GLMMadaptive:::chol_transf(D)

D_chol_to_D <- function(x) {
  
  # transform from entries of cholesky factor with log-transformed main diagonal
  # to covariance matrix
  D <- GLMMadaptive:::chol_transf(x)
  
  D[upper.tri(D, diag = TRUE)]
}

J <- jacobian(D_chol_to_D, D_chol_entries)

# estimated covariance matrix of D_chol_entries
V_chol <- vcov(fm, parm = "var-cov")

# estimated covariance matrix of entries of D
V <- J %*% V_chol %*% t(J)

se <- sqrt(diag(V))

from glmmadaptive.

Related Issues (20)

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.