factanal.predictive: Probabilistically predictive factor analysis

Description Usage Arguments Value Author(s) References See Also Examples

Description

A wrapper function for using the factanal function predictively. Several methods are available for exploring the predictions of fitted factor analysis models.

Usage

 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
factanal.predictive(x, factors, ...)

## S3 method for class 'factanal.predictive'
AIC(object, ..., k = 2, corrected = TRUE)

## S3 method for class 'factanal.predictive'
biplot(x, newdata, axes=c(1,2), 
which.var=1:x$n.vars, ...)

## S3 method for class 'factanal.predictive'
deviance(object, ...)

## S3 method for class 'factanal.predictive'
logLik(object, ...)

## S3 method for class 'factanal.predictive'
pairs(x, vars = 1:x$n.vars, ls = FALSE, ...)

## S3 method for class 'factanal.predictive'
predict(object, newdata, responses = c(1), 
predictors = (1:object$n.vars)[-responses], ...)

## S3 method for class 'factanal.predictive'
scores(x, newdata, which.var=1:x$n.vars, ...)

## S3 method for class 'factanal.predictive'
screeplot(x, stat = "deviance", shift = TRUE, 
plot = TRUE, ylab, main, grey.int=0.8, ...)

Arguments

x

For factanal.predictive: A data frame, numeric matrix or any object that can be coerced into a numeric matrix. Unlike factanal, this argument cannot be a formula or missing. For methods: An object of class factanal.predictive.

object

An object of class factanal.predictive.

factors

Number of factors to be fitted.

k

Not used. Included for consistency with the default method.

corrected

If TRUE the returned information criterion is corrected for small multivariate samples (called MAICc). If FALSE the standard AIC is returned.

axes

Vector of length 2 containing the numbers associated with the axes to be plotted. If the model contains only a single factor (i.e. axis), then random 'jitter' is plotted on the y-axis to improve visualisation of the plotted factor on the x-axis. If more than two axes are supplied, the first two are used with a warning.

vars

Vector giving the numbers associated with the variables to be plotted. Must contain at least two variables.

ls

If TRUE, the least-squares fit is also shown for comparison.

newdata

An optional data frame in which to look for variables with which to predict. If omitted, the fitted values are used.

responses

Vector giving the numbers associated with the variables to be treated as 'responses'.

predictors

Vector giving the numbers associated with the variables to be treated as 'predictors'.

which.var

Vector giving the numbers associated with the variables to be used in axis calculation.

stat

Character string of the name of a function that returns a statistic quantifying the 'performance' of a fitted factanal.predictive object. The default, deviance, results in strictly non-increasing screeplots, which is the classical behaviour of such plots. Other options are logLik, AIC, or a user-defined function.

shift

If TRUE the y-axis is shifted such that the minimum model is shifted to zero.

plot

If FALSE the plotting is suppressed.

ylab

Label for the y-axis. If omitted the label is taken to be stat.

main

Title for screeplot

grey.int

Grey colour for 'within ten units' region.

...

For factanal.predictive: Further arguments to pass to factanal. However, if one attempts to pass covmat, an error message will be produced. Unlike factanal, estimation cannot take place with a covariance matrix alone. This may be changed in the future. For methods: Further arguments to be passed to the default method. Note that these don't always work. I'll improve the documentation to provide a better explanation for this in the future.

Value

An object of class factanal.predictive that includes the following components, in addition to those that are included in factanal objects:

factors

Either the number of factors in the model or "full" if the number of factors exceeds the maximum number for a factor analysis. If this number is exceeded, a "full" multivariate normal model is fitted that treats all covariances and variances as free parameters.

n.obs

Number of observations (i.e. rows in x).

Cor

The model-implied correlation matrix.

call.pred

The matched call to factanal.predictive.

n.vars

Number of variables (i.e. columns in x).

x

Data matrix passed to factanal.predictive.

Cov

The model-implied covariance matrix.

B

Unstandardized coefficients.

Author(s)

Steve Walker

References

Walker, S.C. and Jackson, D.A. (2011) Random-effects ordination: describing and predicting multivariate correlations and co-occurrences. Ecological Monographs. 81: 635-663.

See Also

This function is based on factanal. For random-effects ordination of presence-absence data see ltm.ecol.

Examples

1
2
limn.fa <- factanal.predictive(limn,2)
scores(limn.fa)

reo documentation built on May 2, 2019, 4:55 p.m.

Related to factanal.predictive in reo...