R/pca_cor_samplevar.R
h_pca_var_rsquared.Rd
This helper function calculates R2 values between one sample variable from AnyHermesData
and all Principal Components (PCs) separately (one linear model is fit for each PC).
h_pca_var_rsquared(pca, x)
(matrix
)
principal components matrix generated by calc_pca()
.
(vector
)
values of one sample variable from a AnyHermesData
object.
A vector with R2 values for each principal component.
Note that in case there are estimation problems for any of the PCs, then NA
will
be returned for those.