Steps with PPBstats

For variance intra analysis, you can follow these steps (Figure \@ref(fig:main-workflow)) :

Format the data

data("data_model_GxE")
data_model_GxE = format_data_PPBstats(data_model_GxE, type = "data_agro")

Look at correlation

library(ggcorrplot)
vec_variables = c("y1", "y2", "y3")
corr = round(cor(data_model_GxE[,vec_variables]), 1)
p.mat = cor_pmat(data_model_GxE[,vec_variables])

# Barring the no significant coefficient
ggcorrplot(corr, hc.order = TRUE, type = "lower", p.mat = p.mat)

More details on the use of ggcorrplot() can be found here.

Run the analysis

vec_variables = c("y1", "y2", "y3")
res.pca = mutlivariate(data_model_GxE, vec_variables, PCA)

Check outputs and results

Look at the results thanks to the factoextra package:

fviz_eig(res.pca)
fviz_pca_ind(res.pca, label="none", habillage="location", addEllipses=TRUE, ellipse.level=0.95)


priviere/PPBstats documentation built on May 6, 2021, 1:20 a.m.