I have the following code #load the data library(readxl) library(dplyr) #loading the raw…
- User
I have the following code #load the data library(readxl) library(dplyr) #loading the raw data #setwd(“C:/Users/defaultuser0.LAPTOP-10STVJBB/Desktop/R”) raw_data = read_excel(‘dataFA.xlsx’) #feature engineering. The SS variable are the correlations between the real #averages (faces/numbers/weighted average) and subject’s estimation. We defined summary statistics #(SS) performance with correlation (and nor RMSD for example) to avoid constant biases in #subject’s estimations(that are observed in RMSD, but avoided in correlations) my_data = raw_data %>% group_by(as.factor(sub_num))%>% summarise(WADD = mean(WADD_Acc),WADD_rule = mean(WADDrule_Acc), SS_faces = cor(real_Average_faces,sub_response_faces), SS_AA = cor(real_Average_AA,sub_response_AA), SS_WA3 = cor(real_Weighted_WA3,sub_response_WA3), SS_WA4 = cor(real_Weighted_WA4,sub_response_WA4))%>% ungroup()
my_data = my_data[2:7] #ridge regression to predict job candidate performance from the averaging tasks perfomances #pca library(caret) library(leaps) library(rsample) library(recipes) library(yardstick) library(tidyverse) library(recipes)
library(psych) library(parameters) library(performance)
PCA ---------------------------------------------------------------------
How many components? ---------------------
pca_my_data = my_data n <- n_factors(pca_my_data)
as.data.frame(n)
coefficients <- coef(mod.elasticfinalModel, s = lambda) coefficients - and I’m not 100% sure what to do next. I geuss I need to normelize my data and then rotated the PCA components, But I have no clue how to do it or what to do next. please generate this code for me.
- Assistant
I'm sorry, but the code you provided is not complete and contains errors. For instance, the
mod.elasticfinalModelobject used in the line is not defined anywhere in the code. Additionally, there seems to be a typo in the line , which should probably be to subset the columns correctly. - User
- Assistant