sjPlot (version 2.0.0)

sjt.pca: Summary of principal component analysis as HTML table

Description

Performes a principle component analysis on a data frame or matrix (with varimax rotation) and displays the factor solution as HTML table, or saves them as file. In case a data frame is used as parameter, the Cronbach's Alpha value for each factor scale will be calculated, i.e. all variables with the highest loading for a factor are taken for the reliability test. The result is an alpha value for each factor dimension.

Usage

sjt.pca(data, nmbr.fctr = NULL, fctr.load.tlrn = 0.1,
  title = "Principal Component Analysis (with varimax rotation)",
  var.labels = NULL, wrap.labels = 40, show.cronb = TRUE,
  show.msa = FALSE, show.var = FALSE, altr.row.col = FALSE, digits = 2,
  string.pov = "Proportion of Variance",
  string.cpov = "Cumulative Proportion", CSS = NULL, encoding = NULL,
  file = NULL, use.viewer = TRUE, no.output = FALSE,
  remove.spaces = TRUE)

Arguments

Value

Invisibly returns
  • the web page style sheet (page.style),
  • the web page content (page.content),
  • the complete html-output (output.complete),
  • the html-table with inline-css for use with knitr (knitr),
  • thefactor.index, i.e. the column index of each variable with the highest factor loading for each factor and
  • theremoved.items, i.e. which variables have been removed because they were outside of thefctr.load.tlrn's range.
for further use.

Details

See 'Details' in sjt.frq.

See Also

  • http://www.strengejacke.de/sjPlot/sjt.pca/{sjPlot manual: sjt.pca}
  • sjp.pca

Examples

Run this code
# Data from the EUROFAMCARE sample dataset
library(sjmisc)
data(efc)

# retrieve variable and value labels
varlabs <- get_label(efc)

# recveive first item of COPE-index scale
start <- which(colnames(efc) == "c82cop1")
# recveive last item of COPE-index scale
end <- which(colnames(efc) == "c90cop9")
 
# create data frame with COPE-index scale
mydf <- as.data.frame(efc[, c(start:end)])
colnames(mydf) <- varlabs[c(start:end)]

sjt.pca(mydf)

# auto-detection of labels
sjt.pca(efc[, c(start:end)])

Run the code above in your browser using DataLab