fit_pca: 주성분 분해

View source: R/principal-component-analysis.R

fit_pcaR Documentation

주성분 분해

Description

주어진 데이터에 대하여 주성분을 분해한다.

Usage

fit_pca(
  .data,
  .xvar = tidyselect::everything(),
  .pc = NULL,
  .center = TRUE,
  .scale = TRUE
)

Arguments

.data

관측 데이터 프레임.

.xvar

독립변수. 독립변수가 여러 개일 때는 벡터 형태로 제공한다. (e.g. c(age, height)). Default: everthing(), .data의 모든 변수에 대한 주성분 분해를 수행한다.

.pc

추출할 주성분의 수.

.center

평균조정 여부. TRUE이면 각 독립변수에 대해 평균조정을 수행한다.

.scale

분산조정 여부. TRUE이면 각 독립변수에 대해 분산조정을 수행한다.

Value

리스트. 고유치 eig, 주성분행렬 score, 상관로딩 loading, 주성분 수 ncomp, 주성분 변동 기여율 R2, 평균조정 시 평균벡터 center, 분산조정 시 표본표준편차 벡터 scale.

Examples

data(biometric, package = "dmtr")
fit1 <- fit_pca(biometric, c(age, height, weight), .pc = 2L)
fit2 <- fit_pca(biometric, .pc = 2L)


youngroklee-ml/dmtr documentation built on June 12, 2022, 6:24 p.m.