GithubHelp home page GithubHelp logo

tidy lavaan output about broom HOT 7 CLOSED

tidymodels avatar tidymodels commented on July 19, 2024
tidy lavaan output

from broom.

Comments (7)

dgrtwo avatar dgrtwo commented on July 19, 2024

I'd also like to have that included! But I've put some time into exploring tidying methods for lavaan objects, and the objects are pretty intense. Take a look, for instance, at getMethod(summary, "lavaan"): there are many possible contents depending on the kind of fit, and some of them are stored in a counterintuitive way.

It's also unclear what the tidy results would be, as each latent variable model stores multiple tables. I'm sure it's possible to construct a tidied version, but I'm worried I might not be the one to do it (as I'm not familiar with the package as a user).

If you had some specific ideas for the input and output for tidying methods (or better yet, code for some of them) I'd be very happy to help incorporate them into the package!

One thing I was able to cook up was a glance method, but that's just a start:

glance.lavaan <- function(x, ...) {
  ret <- as.data.frame(t(unclass(fitMeasures(x))))
  # rename some to fit conventions of the package
  ret <- plyr::rename(ret, c(aic = "AIC", bic = "BIC", logl = "logLik"))
  names(ret) <- gsub("pvalue", "p.value", names(ret))
  ret
}

from broom.

tjmahr avatar tjmahr commented on July 19, 2024

Just chiming in to agree that glance would wrap fitmeasures, and note that tidy would wrap parameterestimates.

from broom.

puterleat avatar puterleat commented on July 19, 2024

Ive added a PR here which includes glance and tidy methods. Needs some thought to work out what augment should do.

from broom.

DominiqueMakowski avatar DominiqueMakowski commented on July 19, 2024

Any advances on this?

from broom.

alexpghayes avatar alexpghayes commented on July 19, 2024

You can follow along at #233. Adding new tidiers is not the highest priority at the moment, so if you're hoping for new tidiers sooner rather than later the best way is to make a PR.

from broom.

alexpghayes avatar alexpghayes commented on July 19, 2024

Merged! Small changes likely to come to the column names in glance before the broom 0.5.0 release.

from broom.

github-actions avatar github-actions commented on July 19, 2024

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

from broom.

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.