1. the code above yields R-square for the two mediators and the outcome variable only. Is there a way to request the R-square for all predictors in the model?
2. Is it also possible to request a p-value for each r-square generated?
3. I am interested in d21 (path between two mediators) and would also like to have an r-square for this--would this be possible?
--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.
Question 1: How would I use bootstrapLavaan()to request the CI for Rsquared?
Is it possible to get CI's for these three R squared values? If so, what is the code I should use?
example(sem)
(PE <- parameterEstimates(fit, rsquare = TRUE)) # the R-squared values are in rows where "op" is "r2"
PE$est[PE$op == "r2"]
myFunc <- function(object) parameterEstimates(object, rsquare = TRUE)$est[PE$op == "r2"]
bootOut <- bootstrapLavaan(fit, R = 1000, FUN = myFunc)
head(bootOut) # first few bootstraps of each R-squared, some NAs when estimated residual variance is negative
## percentile 95% CIs
apply(bootOut, 2, quantile, probs = c(.025, .975), na.rm = TRUE)
Question 2: On a slightly different note, when estimating the indirect effect in this model, I find that the p-value for the effect (a1d21b2) and the bootstrap CI (n=10000) do not agree. p=.055, CI=does not include 0
If I understood it correctly, if the item error variance is reasonably small, and the CI crosses zero, then it is possible to assume that the true value is actually nonegative.
I tried to follow the code you provided in this post, however, since the value is in the row, I don't really know for sure how to write the syntax.
--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/bada0e2e-e966-4583-bd2c-3605b727431e%40googlegroups.com.
What is your thought?