### Load example dataset
data("pp15", package="rosetta");
### Get variable names with expected
### effects of a high dose of MDMA
items <-
grep(
"highDose_AttBeliefs_",
names(pp15),
value=TRUE
);
### Do a factor analysis
rosetta::factorAnalysis(
data = pp15,
items = items,
nfactors = "eigen",
scree = TRUE
);
if (FALSE) {
### To get more output, show the
### output as Rmd Partial in the viewer,
### and color/size the factor loadings
rosetta::rosettaDataReduction_partial(
rosetta::factorAnalysis(
data = pp15,
items = items,
nfactors = "eigen",
summary = TRUE,
correlations = TRUE,
colorLoadings = TRUE
)
);
}
Run the code above in your browser using DataLab