View source: R/factorScorePfa.R

factorScorePfa | R Documentation |

Perform principal factor factor analysis on a covariance matrix or data matrix.

```
factorScorePfa(x, factors = 2, covmat = NULL, cor = FALSE,
rotation = c("varimax", "none"),
scoresMethod = c("none", "regression", "Bartlett"))
```

`x` |
A numeric matrix or an object that can be coerced to a numeric matrix. |

`factors` |
The number of factors to be fitted. |

`covmat` |
A covariance matrix, or a covariance list as returned by |

`cor` |
A logical value indicating whether the calculation should use the covariance matrix ( |

`rotation` |
character. "none" or "varimax": it will be called with first argument the loadings matrix, and should return a list with component |

`scoresMethod` |
Type of scores to produce, if any. The default is |

Other feasible usages are:

`factorScorePfa(factors, covmat)`

`factorScorePfa(x, factors, rotation, scoresMethod)`

If `x`

is missing, then the following components of the result will be NULL: scores, ScoringCoef, meanF, corF, and n.obs.

An object of class `"factorScorePfa"`

with components:

`call ` |
The matched call. |

`loadings ` |
A matrix of loadings, one column for each factor. This is of class |

`communality ` |
The common variance. |

`uniquenesses ` |
The uniquenesses/specific variance computed. |

`covariance ` |
The robust/classical covariance matrix. |

`correlation ` |
The robust/classical correlation matrix. |

`usedMatrix ` |
The used matrix (running matrix). It may be the covariance or correlation matrix according to the value of |

`reducedCorrelation ` |
The last reduced correlation matrix. |

`factors ` |
The argument factors. |

`method ` |
The method: always |

`scores ` |
If requested, a matrix of scores. NULL if |

`scoringCoef ` |
The scoring coefficients. NULL if |

`meanF ` |
The sample mean of the scores. NULL if |

`corF ` |
The sample correlation matrix of the scores. NULL if |

`scoresMethod ` |
The argument |

`n.obs ` |
The number of observations if available. NULL if |

`center ` |
The center of the data. |

`eigenvalues ` |
The eigenvalues of the usedMatrix. |

Ying-Ying Zhang (Robert) robertzhangyying@qq.com

Zhang, Y. Y. (2013), An Object Oriented Solution for Robust Factor Analysis.

`factorScorePca`

, `factanal`

```
data(stock611)
R611 = cor(stock611[,3:12]); R611
## covmat is a matrix
fsPfa1 = factorScorePfa(factors = 3, covmat = R611); fsPfa1
## covmat is a list
covx = rrcov::Cov(stock611[,3:12])
covmat = list(cov = rrcov::getCov(covx), center = rrcov::getCenter(covx), n.obs = covx@n.obs)
fsPfa2 = factorScorePfa(factors = 3, cor = TRUE, covmat = covmat); fsPfa2
## fsPfa3 contains scores etc.
fsPfa3 = factorScorePfa(x = stock611[,3:12], factors = 2,
cor = TRUE, rotation = "varimax", scoresMethod = "regression"); fsPfa3
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.