Learn R Programming

lavaan.survey (version 1.1.3.1)

pval.pFsum: F test for model fit of complex survey structural equation models

Description

Uses the pFsum function from the survey package to obtain a p-value for the overall model fit of a lavaan fit object using an F reference distribution, where the denominator degrees of freedom is the design degrees of freedom, degf(survey.design).

Usage

pval.pFsum(lavaan.fit, survey.design, method = "saddlepoint")

Arguments

lavaan.fit
A lavaan object resulting from a lavaan call. Since this is the estimator that will be used in the complex sample estimates, for comparability it can be convenient to use the same estimator in the call generating the lavaan fit object as in the lavaan.survey call. By default this is "MLM".
survey.design
An svydesign object resulting from a call to svydesign in the survey package. This allows for incorporation of clustering, stratification, unequal probability weights, finite population correction, and multiple imputation. See the survey documentation for more information.
method
The method by which the distribution of the overall model fit statistic is approximated. See Details on the pFsum help page.

Value

A p-value for the overall F test of model fit, adjusted for nonnormality and the complex sampling design.

Details

With a small number of primary sampling units (design degrees of freedom), the asymptotic chi-square approximation to the distribution of the test statistic may not be entirely accurate. In this case instead of a chi-square, an F-reference distribution using the design degrees of freedom may be used.

When degf is infinite, the p-value output by this function be equal the Satterthwaite ("MLMVS") p-value (see lavaan "test" options).

The eigenvalues of the U.Gamma matrix, which is used by lavaan to calculate Satorra-Bentler scaling corrections, will be the coefficients in the mixture of chi-squares distribution (Skinner, Holt & Smith, pp. 86-87).

An anonymous reviewer for the Journal of Statistical Software suggested that "in surveys with small numbers of primary sampling units this sort of correction has often improved the behavior of tests in other contexts."

References

Skinner C, Holt D, Smith T (1989). Analysis of Complex Surveys. John Wiley & Sons, New York.

Oberski, D.L. (2014). lavaan.survey: An R Package for Complex Survey Analysis of Structural Equation Models. Journal of Statistical Software, 57(1), 1-27. http://www.jstatsoft.org/v57/i01/.

See Also

cardinale lavaan.survey pFsum degf svydesign lavaan

Examples

Run this code
# Load HolzingerSwineford1939 data
data("HolzingerSwineford1939")

# Create 43 fake clusters
HolzingerSwineford1939$fake.cluster <- rep(1:43, each=7)
# Create survey design object
des <- svydesign(ids=~fake.cluster, probs=~1, data=HolzingerSwineford1939)

# Show the design degrees of freedom: number of clusters - 1
degf(des) # 42

# A reduced factor model that has a larger p-value :
HS.model <- ' visual  =~ x2 + x3
  textual =~ x4 + x5 + x6'

# Fit the factor model without taking complex sampling into account
fit <- cfa(HS.model, data=HolzingerSwineford1939, estimator="MLMVS")

# Fit the factor model, taking the 43 clusters into account
fit.svy <- lavaan.survey(fit, survey.design=des, estimator="MLMVS")

# Calculate the F test p-value. 
# Since degf is only 42, there is a difference with Satterthwaite chi-square
pval.pFsum(fit.svy, survey.design=des)  # 0.0542468133

Run the code above in your browser using DataLab