How to obtain precise p-values in R when using Lavaan for CFA?

Hey everyone! I’m pretty new to R and I’m trying to do a Confirmatory Factor Analysis (CFA) with the Lavaan package. Everything’s going okay, but I’ve hit a snag. The p-value I’m getting is just showing up as .000, and I really need to know the exact value (like .0000009 or whatever it actually is).

I tried a couple things to fix this:

format.pval(p, digits=6)
options(digits=10)

But no luck. They didn’t change anything in my output.

Here’s the code I’m using for the CFA:

my_fit <- cfa(my_model, data=my_full_data, estimator = "WLSMV") 
summary(my_fit, fit.measures=TRUE, standardized=TRUE)  

Any ideas on how I can get Lavaan to show me the full p-value? I’d really appreciate any help!

have u tried using signif() function? it might help with getting more precise p-values. also, check out the parameterEstimates() function from lavaan. it sometimes gives more detailed output. if those don’t work, maybe try bootstrapping to get confidence intervals instead of relying on p-values?

I’ve encountered this issue before when working with Lavaan. One solution that worked for me was using the parameterEstimates() function instead of summary(). It tends to provide more detailed output, including more precise p-values.

Try this code:

pe <- parameterEstimates(my_fit, standardized = TRUE)
print(pe, digits = 10)

This should give you p-values with more decimal places. If you’re still not getting the precision you need, you might want to consider using bootstrap methods to calculate confidence intervals. These can be more informative than p-values, especially when dealing with very small values.

Alternatively, if you’re set on getting exact p-values, you could extract the test statistic and degrees of freedom from the model output and calculate the p-value manually using the appropriate distribution function in R.