Issues with summary output on Jupyter Notebook since update

84 views
Skip to first unread message

Gold Okafor

unread,
Jul 28, 2022, 8:58:03 PM7/28/22
to lavaan
Hello,

Ever since the recent lavaan update, the lavaan summary function does not seem to work when you run r on Juypter Notebook. Instead of the normal summary for a cfa(), it provides a short list of the summary variables.  Prior to the update, it has been working fine. My r, Jupyter Notebook, and computer are all up-to-date. Below is example code and attached is a screenshoot. Any help would be greatly appreciated. 

visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9

HS.model <- ' visual  =~ x1 + x2 + x3
              textual =~ x4 + x5 + x6
              speed   =~ x7 + x8 + x9 '

fit <- cfa(HS.model, data = HolzingerSwineford1939)

summary(fit, fit.measures = TRUE)

Output:

$header$lavaan.version'0.6-12'$sam.approachFALSE$optim.method'nlminb'$optim.iterations35$optim.convergedTRUE$optim$estimator'ML'$estimator.args
    $optim.method'nlminb'$npar21$eq.constraintsFALSE$nrow.ceq.jac0$nrow.cin.jac0$nrow.con.jac0$con.jac.rank0$data$ngroups1$nobs301$test$standard =$test'standard'$stat85.3055217699727$stat.group85.3055217699727$df24$refdistr'chisq'$pvalue8.50255321704907e-09


    Best,

    Gold Okafor


    Screen Shot 2022-07-28 at 5.43.22 PM.png

    Yves Rosseel

    unread,
    Jul 29, 2022, 4:12:08 AM7/29/22
    to lav...@googlegroups.com
    First some background:

    In >= 0.6-12, the summary() function is completely silent (following
    'standard' R protocols). This means that

    out <- summary(fit, fit.measures = TRUE)

    should not print anything to the screen any longer. Instead, a list with
    ingredients is stored in 'out'. You can then 'print' the content of out
    by just typing

    out

    What 'should' happen is that R finds the corresponding printing
    function, which is

    lavaan:::print.lavaan.summary(out)

    This should all happen automatically when you just type

    summary(fit, fit.measures = TRUE)


    I have no experience with Jupyter Notebooks. In anycase, reboot first.
    If you type

    out <- summary(fit, fit.measures = TRUE)

    what is the output of

    class(out)?

    It should be "lavaan.summary" "list". Do you get any output if you use

    lavaan:::print.lavaan.summary(out)?

    lavaan is just using R's standard S3 system to dispatch the print()
    function to print.lavaan.summary(). Is Jupyter Notebook somehow
    interfering with this print() function?

    Yves.

    Gold Okafor

    unread,
    Jul 30, 2022, 7:24:01 PM7/30/22
    to lav...@googlegroups.com
    Hi Yves,

    Thank you so much for your timely response. I was able to temporarily address this issue by reverting the lavaan package to the previous version. I have an upcoming deadline that requires me to use the lavaan package a lot. Once that deadline has passed, I will try your suggestions and report back.

    Best,

    Gold Okafor (she/her)
    PhD Candidate, Social/Personality Program
    Department of Psychology
    University of California, Berkeley




    --
    You received this message because you are subscribed to a topic in the Google Groups "lavaan" group.
    To unsubscribe from this topic, visit https://groups.google.com/d/topic/lavaan/XXmVfheAGE8/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to lavaan+un...@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/1ce669cb-3afb-123b-46f2-67a73a8241fb%40gmail.com.
    Reply all
    Reply to author
    Forward
    0 new messages