It is not necessary to understand this help page if one merely wants to estimate a factor analysis model. This help page is intended for those who want to modify or extend FAiR or otherwise want some idea of how FAiR works “behind the scenes”.
This class defines an equality restriction for use in a semi-exploratory or confirmatory factor analysis model.
Objects can be created by calls of the form
However, rarely if ever, would a user need to construct an object this way.
make_restrictions methods do so internally.
an integer indicating which cell of a primary pattern matrix is considered “free”
an integer vector indicating which cells of a primary pattern matrix are constrained to be equal to the “free” cell
an integer vector of length two indicating the dimensions of the primary pattern matrix under consideration
a character vector of rownames for the primary pattern matrix under consideration
2L indicating the level
of the factor analysis model under consideration
signature(object = "equality_restriction"): Prints the
equality restriction to the screen
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
showClass("equality_restriction") man <- make_manifest(covmat = ability.cov) ## Here is how to set up an equality restriction in a SEFA model the hard way beta <- matrix(NA_real_, nrow = nrow(cormat(man)), ncol = 2) rownames(beta) <- rownames(cormat(man)) beta[6,2] <- Inf # "fix" beta[6,2] to Inf provisionally ## Note 11L corresponds to beta[5,2] and 12L corresponds to beta[6,2] ER <- new("equality_restriction", free = 11L, fixed = 12L, dims = dim(beta), rownames = rownames(cormat(man)), level = 1L) free <- is.na(beta) # i.e. all but beta[6,2] beta <- new("parameter.coef.SEFA", x = beta, free = free, num_free = sum(free), equalities = list(ER)) Phi <- diag(2) free <- lower.tri(Phi) Phi <- new("parameter.cormat", x = Phi, free = free, num_free = sum(free)) ## Now set up a restriction to prohibit the equal coefficients from being zero blockers <- matrix(FALSE, nrow = nrow(cormat(man)), ncol = 2) blockers[5:6,2] <- TRUE # these two cells are hence not allowed to both be zero res <- make_restrictions(manifest = man, beta = beta, Phi = Phi, discrepancy = "MLE", criteria = list("block_1st"), methodArgs = list(blockers = blockers)) ## Not run: ## Here is the easy way to do the same thing, in the following pop-up menus ## select the options to impose equality restrictions and inequality ## restrictions (block those coefficients from being zero in a SEFA model) res <- make_restrictions(manifest = man, factors = 2, model = "SEFA") ## End(Not run) show(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.