score: Factor and Component Scores

View source: R/score.R

scoreR Documentation

Factor and Component Scores

Description

score calculates principal component or factor scores based on the model generated by PCA and FA functions

Usage

score(data, model)

Arguments

data

the data frame used to generate a PCA or FA model.

model

the model generated by the PCA or FA functions.

Details

The score function adds component or factor scores to a data frame. Scores are calculated using the regression method.

Value

the data frame with component or factor scores appended.

Examples

ratings <- read.csv("https://www.promptcloud.com/wp-content/uploads/2017/02/EFA.csv")
fit.pca <- PCA(ratings, nfactors=2, rotate="varimax")
newdf <- score(ratings, fit.pca)
head(newdf)

Rkabacoff/factorAnalysis documentation built on March 21, 2022, 3:15 p.m.