2
$\begingroup$

I have fit a Bayesian SEM using the R package blavaan.

  Number of observations                            58

  Number of missing patterns                         1

  Statistic                                 MargLogLik         PPP
  Value                                       -384.987       0.432

Parameter Estimates:


Regressions:
                   Estimate  Post.SD  HPD.025  HPD.975   Std.lv  Std.all     PSRF     neff     Prior     
  Nfixers ~                                                                                              
    temp              1.828    0.312    1.201    2.446    1.828    0.458    1.018   163.000 dnorm(0,1e-2)
    Ncat             -1.717    0.207   -2.129   -1.311   -1.717   -0.654    1.002   827.000 dnorm(0,1e-2)
  nonNfixers ~                                                                                           
    Ncat              3.173    0.219     2.74    3.608    3.173    0.887    1.007   246.000 dnorm(0,1e-2)
  Nfix ~                                                                                                 
    temp              0.739    0.318    0.116    1.393    0.739    0.267    1.072   146.000 dnorm(0,1e-2)
    Nfixers           0.298    0.084    0.137    0.468    0.298    0.429    1.009  1971.000 dnorm(0,1e-2)
  Nup ~                                                                                                  
    nonNfixers        0.243    0.057     0.13    0.354    0.243    0.477    1.004  1289.000 dnorm(0,1e-2)
    temp              0.912    0.264    0.367    1.408    0.912    0.329    1.012   124.000 dnorm(0,1e-2)
  GPP ~                                                                                                  
    Nfixers           0.403    0.149    0.122    0.703    0.403    0.421    1.082   174.000 dnorm(0,1e-2)
    nonNfixers        0.692    0.105    0.491    0.905    0.692    0.985    1.049   203.000 dnorm(0,1e-2)
    temp              1.139    0.401    0.388     1.93    1.139    0.299    1.266    45.000 dnorm(0,1e-2)

Covariances:
                   Estimate  Post.SD  HPD.025  HPD.975   Std.lv  Std.all     PSRF     neff     Prior     
 .nonNfixers ~~                                                                                          
   .Nup               0.096    0.069   -0.036    0.238    0.096    0.185    1.001   250.000    dbeta(1,1)
   .GPP              -0.191    0.088   -0.358   -0.021   -0.191   -0.335    1.018   187.000    dbeta(1,1)
 .Nfixers ~~                                                                                             
   .nonNfixers       -0.127    0.069   -0.272    0.007   -0.127   -0.227    1.014   413.000    dbeta(1,1)
 .Nfix ~~                                                                                                
   .Nup              -0.006    0.059   -0.124     0.11   -0.006   -0.014    1.003   613.000    dbeta(1,1)
   .GPP               0.075    0.060   -0.044    0.194    0.075    0.150    1.012   489.000    dbeta(1,1)
 .Nup ~~                                                                                                 
   .GPP               0.112    0.064   -0.013    0.243    0.112    0.227    1.014   460.000    dbeta(1,1)

Intercepts:
                   Estimate  Post.SD  HPD.025  HPD.975   Std.lv  Std.all     PSRF     neff     Prior     
   .Nfixers          -0.687    0.886   -2.442    1.102   -0.687   -0.557    1.019   141.000 dnorm(0,1e-3)
   .nonNfixers       -2.609    0.386   -3.371   -1.863   -2.609   -1.554    1.005   221.000 dnorm(0,1e-3)
   .Nfix             -0.171    0.788   -1.838    1.331   -0.171   -0.200    1.073   157.000 dnorm(0,1e-3)
   .Nup               3.432    0.696    2.089    4.846    3.432    4.006    1.012   123.000 dnorm(0,1e-3)
   .GPP               3.645    0.817    2.218    5.408    3.645    3.093    1.272    71.000 dnorm(0,1e-3)

Variances:
                   Estimate  Post.SD  HPD.025  HPD.975   Std.lv  Std.all     PSRF     neff     Prior     
   .Nfixers           0.527    0.102    0.345     0.73    0.527    0.346    1.000  6178.000  dgamma(1,.5)
   .nonNfixers        0.600    0.112    0.396     0.82    0.600    0.213    1.001  2530.000  dgamma(1,.5)
   .Nfix              0.467    0.092    0.302    0.647    0.467    0.636    1.000 10073.000  dgamma(1,.5)
   .Nup               0.447    0.087    0.294    0.625    0.447    0.609    1.000  3288.000  dgamma(1,.5)
   .GPP               0.541    0.109     0.35    0.762    0.541    0.389    1.005  1075.000  dgamma(1,.5)

I have been using trace plots to evaluate parameters and model performance, here is the example of a plot for one parameter:

enter image description here

However, I'm trying to figure out which model parameter is represented here, in this case lambda[3,14,1]? Does anyone know how to find/extract this information in blavaan? The closest resource I could find was this site: https://faculty.missouri.edu/~merklee/blavaan/prior.html and while it gives you an idea of what the greek letters represent it doesn't mention what the numbers in the brackets correspond to.

$\endgroup$

1 Answer 1

4
$\begingroup$

EDIT: In the development version of blavaan, the axis labels should now match the blavaan parameter names, so that the below is unnecessary. (This feature will eventually make it to CRAN in blavaan 0.3-3.)

If you use numbers in the plot command, the numbers should correspond to the ordering of parameters in coef(fit). For example, plot(fit, 1:4) should give you trace plots of the first four parameters found in coef(fit). To find specific parameters (like lambda[3,14,1]), it currently depends on whether you are using JAGS or Stan as your target (eventually, this will be more uniform). For JAGS:

pt <- parTable(fit)
pt[pt$pxnames=="lambda[3,14,1]" & !is.na(pt$pxnames), 2:4]

For Stan:

pt <- parTable(fit)
pt$pxnames <- with(pt, paste0(mat, "[", row, ",", col, ",", group, "]"))
pt[pt$pxnames=="lambda[3,14,1]", 2:4]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.