# Factor analysis in complex surveys (experimental).

### Description

This function fits a factor analysis model or SEM, by maximum weighted likelihood.

### Usage

1 2 |

### Arguments

`formula` |
Model formula specifying the variables to use |

`design` |
Survey design object |

`factors` |
Number of factors to estimate |

`n` |
Sample size to be used for testing: see below |

`...` |
Other arguments to pass to |

### Details

The population covariance matrix is estimated by `svyvar`

and passed to `factanal`

Although fitting these models requires only the estimated covariance
matrix, inference requires a sample size. With `n="sample"`

, the sample size is taken to be
the number of observations; with `n="degf"`

, the survey degrees of
freedom as returned by `degf`

. Using `"sample"`

corresponds to standardizing weights to have mean 1, and is known to
result in anti-conservative tests.

The other two methods estimate an effective sample size for each
variable as the sample size where the standard error of a variance of a
Normal distribution would match the design-based standard error
estimated by `svyvar`

. With `n="min.effective"`

the
minimum sample size across the variables is used; with
`n="effective"`

the harmonic mean is used. For `svyfactanal`

the test of model adequacy is optional, and the default choice,
`n="none"`

, does not do the test.

### Value

An object of class `factanal`

### References

.

### See Also

`factanal`

The `lavaan.survey`

package fits structural equation models to complex samples using similar techniques.

### Examples

1 2 3 4 5 6 7 8 9 | ```
data(api)
dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc)
svyfactanal(~api99+api00+hsg+meals+ell+emer, design=dclus1, factors=2)
svyfactanal(~api99+api00+hsg+meals+ell+emer, design=dclus1, factors=2, n="effective")
##Population dat for comparison
factanal(~api99+api00+hsg+meals+ell+emer, data=apipop, factors=2)
``` |