corrplot(cor(pca_df), method = 'circle', diag = FALSE, type = 'upper', addCoef.col = 'black')
dev.off()
# Look at correlations (unncomment commands below if want to produce graphics)
#bitmap('vqual-corr.tiff', height = 8, width = 8, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-corr.eps", height = 8, width = 8, paper = 'special')
# pdf('vqual-corr.pdf', height = 8, width = 8)
png('vqual-corr.png', width=8, height=6)
corrplot(cor(pca_df), method = 'circle', diag = FALSE, type = 'upper', addCoef.col = 'black')
dev.off()
# Subset for PCA
pca_df <- df %>% dplyr::select(H1c_scaled, H1H2c_scaled, H1A1c_scaled, H1A2c_scaled, H1A3c_scaled, CPP_scaled)
# Change column names
colnames(pca_df) <- c('H1*', 'H1* - H2*', 'H1* - A1*', 'H1* - A2*', 'H1* - A3*', 'CPP')
# Look at correlations (unncomment commands below if want to produce graphics)
#bitmap('vqual-corr.tiff', height = 8, width = 8, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-corr.eps", height = 8, width = 8, paper = 'special')
# pdf('vqual-corr.pdf', height = 8, width = 8)
png('vqual-corr.png', width=8, height=6)
corrplot(cor(pca_df), method = 'circle', diag = FALSE, type = 'upper', addCoef.col = 'black')
dev.off()
# Run PCA
vq.pca <- PCA(pca_df, graph = FALSE, ncp = 6)
# Scree plot (unncomment commands below if want to produce graphics)
#bitmap('vqual-scree.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-scree.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-scree.pdf', height = 4, width = 6)
fviz_screeplot(vq.pca, addlabels = FALSE, title = '') +
geom_text(aes(label = round(vq.pca$eig[, 2], 2)), size = 5, hjust = 0.1, vjust = -0.5) +
theme(text = element_text(size = 15)) +
ylim(0,45)
# dev.off()
# Contributions to dimension 1 (unncomment commands below if want to produce graphics)
#bitmap('vqual-dim1.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-dim1.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-dim1.pdf', height = 4, width = 6)
p <- fviz_contrib(vq.pca, choice = "var", title = '', axes = 1) +
geom_text(aes(label = round(contrib, 2)), vjust = -1, size = 5) +
theme(axis.text = element_text(size = 15),
axis.title = element_text(size = 15)) +
ylim(0, 35)
p$layers[[2]] <- NULL
p
# dev.off()
dev.cur()
dev.off(1)
dev.set(which = dev.next())
# Look at correlations (unncomment commands below if want to produce graphics)
#bitmap('vqual-corr.tiff', height = 8, width = 8, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-corr.eps", height = 8, width = 8, paper = 'special')
# pdf('vqual-corr.pdf', height = 8, width = 8)
png('vqual-corr.png', width=8, height=6)
corrplot(cor(pca_df), method = 'circle', diag = FALSE, type = 'upper', addCoef.col = 'black')
dev.off
dev.off()
# Subset for PCA
pca_df <- df %>% dplyr::select(H1c_scaled, H1H2c_scaled, H1A1c_scaled, H1A2c_scaled, H1A3c_scaled, CPP_scaled)
# Change column names
colnames(pca_df) <- c('H1*', 'H1* - H2*', 'H1* - A1*', 'H1* - A2*', 'H1* - A3*', 'CPP')
# Look at correlations (unncomment commands below if want to produce graphics)
#bitmap('vqual-corr.tiff', height = 8, width = 8, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-corr.eps", height = 8, width = 8, paper = 'special')
# pdf('vqual-corr.pdf', height = 8, width = 8)
png('vqual-corr.png', width=8, height=6)
corrplot(cor(pca_df), method = 'circle', diag = FALSE, type = 'upper', addCoef.col = 'black')
dev.off()
# Run PCA
vq.pca <- PCA(pca_df, graph = FALSE, ncp = 6)
# Scree plot (unncomment commands below if want to produce graphics)
#bitmap('vqual-scree.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-scree.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-scree.pdf', height = 4, width = 6)
fviz_screeplot(vq.pca, addlabels = FALSE, title = '') +
geom_text(aes(label = round(vq.pca$eig[, 2], 2)), size = 5, hjust = 0.1, vjust = -0.5) +
theme(text = element_text(size = 15)) +
ylim(0,45)
# dev.off()
# Contributions to dimension 1 (unncomment commands below if want to produce graphics)
#bitmap('vqual-dim1.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-dim1.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-dim1.pdf', height = 4, width = 6)
p <- fviz_contrib(vq.pca, choice = "var", title = '', axes = 1) +
geom_text(aes(label = round(contrib, 2)), vjust = -1, size = 5) +
theme(axis.text = element_text(size = 15),
axis.title = element_text(size = 15)) +
ylim(0, 35)
p$layers[[2]] <- NULL
p
# dev.off()
# Look at correlations (unncomment commands below if want to produce graphics)
#bitmap('vqual-corr.tiff', height = 8, width = 8, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-corr.eps", height = 8, width = 8, paper = 'special')
# pdf('vqual-corr.pdf', height = 8, width = 8)
png('vqual-corr.png', width=500, height=300)
corrplot(cor(pca_df), method = 'circle', diag = FALSE, type = 'upper', addCoef.col = 'black')
dev.off()
# Subset for PCA
pca_df <- df %>% dplyr::select(H1c_scaled, H1H2c_scaled, H1A1c_scaled, H1A2c_scaled, H1A3c_scaled, CPP_scaled)
# Change column names
colnames(pca_df) <- c('H1*', 'H1* - H2*', 'H1* - A1*', 'H1* - A2*', 'H1* - A3*', 'CPP')
# Look at correlations (unncomment commands below if want to produce graphics)
#bitmap('vqual-corr.tiff', height = 8, width = 8, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-corr.eps", height = 8, width = 8, paper = 'special')
# pdf('vqual-corr.pdf', height = 8, width = 8)
png('vqual-corr.png', width=500, height=300)
corrplot(cor(pca_df), method = 'circle', diag = FALSE, type = 'upper', addCoef.col = 'black')
dev.off()
# Run PCA
vq.pca <- PCA(pca_df, graph = FALSE, ncp = 6)
# Scree plot (unncomment commands below if want to produce graphics)
#bitmap('vqual-scree.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-scree.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-scree.pdf', height = 4, width = 6)
fviz_screeplot(vq.pca, addlabels = FALSE, title = '') +
geom_text(aes(label = round(vq.pca$eig[, 2], 2)), size = 5, hjust = 0.1, vjust = -0.5) +
theme(text = element_text(size = 15)) +
ylim(0,45)
# dev.off()
# Contributions to dimension 1 (unncomment commands below if want to produce graphics)
#bitmap('vqual-dim1.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-dim1.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-dim1.pdf', height = 4, width = 6)
p <- fviz_contrib(vq.pca, choice = "var", title = '', axes = 1) +
geom_text(aes(label = round(contrib, 2)), vjust = -1, size = 5) +
theme(axis.text = element_text(size = 15),
axis.title = element_text(size = 15)) +
ylim(0, 35)
p$layers[[2]] <- NULL
p
# dev.off()
# Subset for PCA
pca_df <- df %>% dplyr::select(H1c_scaled, H1H2c_scaled, H1A1c_scaled, H1A2c_scaled, H1A3c_scaled, CPP_scaled)
# Change column names
colnames(pca_df) <- c('H1*', 'H1* - H2*', 'H1* - A1*', 'H1* - A2*', 'H1* - A3*', 'CPP')
# Look at correlations (unncomment commands below if want to produce graphics)
#bitmap('vqual-corr.tiff', height = 8, width = 8, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-corr.eps", height = 8, width = 8, paper = 'special')
# pdf('vqual-corr.pdf', height = 8, width = 8)
png('vqual-corr.png', width=481, height=444, res=1200, pointsize=4)
corrplot(cor(pca_df), method = 'circle', diag = FALSE, type = 'upper', addCoef.col = 'black')
dev.off()
# Run PCA
vq.pca <- PCA(pca_df, graph = FALSE, ncp = 6)
# Scree plot (unncomment commands below if want to produce graphics)
#bitmap('vqual-scree.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-scree.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-scree.pdf', height = 4, width = 6)
fviz_screeplot(vq.pca, addlabels = FALSE, title = '') +
geom_text(aes(label = round(vq.pca$eig[, 2], 2)), size = 5, hjust = 0.1, vjust = -0.5) +
theme(text = element_text(size = 15)) +
ylim(0,45)
# dev.off()
# Contributions to dimension 1 (unncomment commands below if want to produce graphics)
#bitmap('vqual-dim1.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-dim1.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-dim1.pdf', height = 4, width = 6)
p <- fviz_contrib(vq.pca, choice = "var", title = '', axes = 1) +
geom_text(aes(label = round(contrib, 2)), vjust = -1, size = 5) +
theme(axis.text = element_text(size = 15),
axis.title = element_text(size = 15)) +
ylim(0, 35)
p$layers[[2]] <- NULL
p
# dev.off()
# Subset for PCA
pca_df <- df %>% dplyr::select(H1c_scaled, H1H2c_scaled, H1A1c_scaled, H1A2c_scaled, H1A3c_scaled, CPP_scaled)
# Change column names
colnames(pca_df) <- c('H1*', 'H1* - H2*', 'H1* - A1*', 'H1* - A2*', 'H1* - A3*', 'CPP')
# Look at correlations (unncomment commands below if want to produce graphics)
#bitmap('vqual-corr.tiff', height = 8, width = 8, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-corr.eps", height = 8, width = 8, paper = 'special')
# pdf('vqual-corr.pdf', height = 8, width = 8)
png('vqual-corr.png', width=481, height=444, res=1200)
corrplot(cor(pca_df), method = 'circle', diag = FALSE, type = 'upper', addCoef.col = 'black')
dev.off()
# Run PCA
vq.pca <- PCA(pca_df, graph = FALSE, ncp = 6)
# Scree plot (unncomment commands below if want to produce graphics)
#bitmap('vqual-scree.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-scree.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-scree.pdf', height = 4, width = 6)
fviz_screeplot(vq.pca, addlabels = FALSE, title = '') +
geom_text(aes(label = round(vq.pca$eig[, 2], 2)), size = 5, hjust = 0.1, vjust = -0.5) +
theme(text = element_text(size = 15)) +
ylim(0,45)
# dev.off()
# Contributions to dimension 1 (unncomment commands below if want to produce graphics)
#bitmap('vqual-dim1.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-dim1.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-dim1.pdf', height = 4, width = 6)
p <- fviz_contrib(vq.pca, choice = "var", title = '', axes = 1) +
geom_text(aes(label = round(contrib, 2)), vjust = -1, size = 5) +
theme(axis.text = element_text(size = 15),
axis.title = element_text(size = 15)) +
ylim(0, 35)
p$layers[[2]] <- NULL
p
# dev.off()
# Subset for PCA
pca_df <- df %>% dplyr::select(H1c_scaled, H1H2c_scaled, H1A1c_scaled, H1A2c_scaled, H1A3c_scaled, CPP_scaled)
# Change column names
colnames(pca_df) <- c('H1*', 'H1* - H2*', 'H1* - A1*', 'H1* - A2*', 'H1* - A3*', 'CPP')
# Look at correlations (unncomment commands below if want to produce graphics)
#bitmap('vqual-corr.tiff', height = 8, width = 8, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-corr.eps", height = 8, width = 8, paper = 'special')
# pdf('vqual-corr.pdf', height = 8, width = 8)
png('vqual-corr.png', width=481, height=444, res=800)
corrplot(cor(pca_df), method = 'circle', diag = FALSE, type = 'upper', addCoef.col = 'black')
dev.off()
# Run PCA
vq.pca <- PCA(pca_df, graph = FALSE, ncp = 6)
# Scree plot (unncomment commands below if want to produce graphics)
#bitmap('vqual-scree.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-scree.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-scree.pdf', height = 4, width = 6)
fviz_screeplot(vq.pca, addlabels = FALSE, title = '') +
geom_text(aes(label = round(vq.pca$eig[, 2], 2)), size = 5, hjust = 0.1, vjust = -0.5) +
theme(text = element_text(size = 15)) +
ylim(0,45)
# dev.off()
# Contributions to dimension 1 (unncomment commands below if want to produce graphics)
#bitmap('vqual-dim1.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-dim1.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-dim1.pdf', height = 4, width = 6)
p <- fviz_contrib(vq.pca, choice = "var", title = '', axes = 1) +
geom_text(aes(label = round(contrib, 2)), vjust = -1, size = 5) +
theme(axis.text = element_text(size = 15),
axis.title = element_text(size = 15)) +
ylim(0, 35)
p$layers[[2]] <- NULL
p
# dev.off()
# Subset for PCA
pca_df <- df %>% dplyr::select(H1c_scaled, H1H2c_scaled, H1A1c_scaled, H1A2c_scaled, H1A3c_scaled, CPP_scaled)
# Change column names
colnames(pca_df) <- c('H1*', 'H1* - H2*', 'H1* - A1*', 'H1* - A2*', 'H1* - A3*', 'CPP')
# Look at correlations (unncomment commands below if want to produce graphics)
#bitmap('vqual-corr.tiff', height = 8, width = 8, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-corr.eps", height = 8, width = 8, paper = 'special')
# pdf('vqual-corr.pdf', height = 8, width = 8)
png('vqual-corr.png', width=481, height=444, res=800)
corrplot(cor(pca_df), method = 'circle', diag = FALSE, type = 'upper', addCoef.col = 'black')
dev.off()
# Run PCA
vq.pca <- PCA(pca_df, graph = FALSE, ncp = 6)
# Scree plot (unncomment commands below if want to produce graphics)
#bitmap('vqual-scree.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-scree.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-scree.pdf', height = 4, width = 6)
fviz_screeplot(vq.pca, addlabels = FALSE, title = '') +
geom_text(aes(label = round(vq.pca$eig[, 2], 2)), size = 5, hjust = 0.1, vjust = -0.5) +
theme(text = element_text(size = 15)) +
ylim(0,45)
# dev.off()
# Contributions to dimension 1 (unncomment commands below if want to produce graphics)
#bitmap('vqual-dim1.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-dim1.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-dim1.pdf', height = 4, width = 6)
p <- fviz_contrib(vq.pca, choice = "var", title = '', axes = 1) +
geom_text(aes(label = round(contrib, 2)), vjust = -1, size = 5) +
theme(axis.text = element_text(size = 15),
axis.title = element_text(size = 15)) +
ylim(0, 35)
p$layers[[2]] <- NULL
p
# dev.off()
# Subset for PCA
pca_df <- df %>% dplyr::select(H1c_scaled, H1H2c_scaled, H1A1c_scaled, H1A2c_scaled, H1A3c_scaled, CPP_scaled)
# Change column names
colnames(pca_df) <- c('H1*', 'H1* - H2*', 'H1* - A1*', 'H1* - A2*', 'H1* - A3*', 'CPP')
# Look at correlations (unncomment commands below if want to produce graphics)
#bitmap('vqual-corr.tiff', height = 8, width = 8, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-corr.eps", height = 8, width = 8, paper = 'special')
# pdf('vqual-corr.pdf', height = 8, width = 8)
png('vqual-corr.png', width=481, height=444)
corrplot(cor(pca_df), method = 'circle', diag = FALSE, type = 'upper', addCoef.col = 'black')
dev.off()
# Run PCA
vq.pca <- PCA(pca_df, graph = FALSE, ncp = 6)
# Scree plot (unncomment commands below if want to produce graphics)
#bitmap('vqual-scree.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-scree.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-scree.pdf', height = 4, width = 6)
fviz_screeplot(vq.pca, addlabels = FALSE, title = '') +
geom_text(aes(label = round(vq.pca$eig[, 2], 2)), size = 5, hjust = 0.1, vjust = -0.5) +
theme(text = element_text(size = 15)) +
ylim(0,45)
# dev.off()
# Contributions to dimension 1 (unncomment commands below if want to produce graphics)
#bitmap('vqual-dim1.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-dim1.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-dim1.pdf', height = 4, width = 6)
p <- fviz_contrib(vq.pca, choice = "var", title = '', axes = 1) +
geom_text(aes(label = round(contrib, 2)), vjust = -1, size = 5) +
theme(axis.text = element_text(size = 15),
axis.title = element_text(size = 15)) +
ylim(0, 35)
p$layers[[2]] <- NULL
p
# dev.off()
# Subset for PCA
pca_df <- df %>% dplyr::select(H1c_scaled, H1H2c_scaled, H1A1c_scaled, H1A2c_scaled, H1A3c_scaled, CPP_scaled)
# Change column names
colnames(pca_df) <- c('H1*', 'H1* - H2*', 'H1* - A1*', 'H1* - A2*', 'H1* - A3*', 'CPP')
# Look at correlations (unncomment commands below if want to produce graphics)
#bitmap('vqual-corr.tiff', height = 8, width = 8, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-corr.eps", height = 8, width = 8, paper = 'special')
# pdf('vqual-corr.pdf', height = 8, width = 8)
png('vqual-corr.png', width=481, height=444, res=100)
corrplot(cor(pca_df), method = 'circle', diag = FALSE, type = 'upper', addCoef.col = 'black')
dev.off()
# Run PCA
vq.pca <- PCA(pca_df, graph = FALSE, ncp = 6)
# Scree plot (unncomment commands below if want to produce graphics)
#bitmap('vqual-scree.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-scree.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-scree.pdf', height = 4, width = 6)
fviz_screeplot(vq.pca, addlabels = FALSE, title = '') +
geom_text(aes(label = round(vq.pca$eig[, 2], 2)), size = 5, hjust = 0.1, vjust = -0.5) +
theme(text = element_text(size = 15)) +
ylim(0,45)
# dev.off()
# Contributions to dimension 1 (unncomment commands below if want to produce graphics)
#bitmap('vqual-dim1.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-dim1.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-dim1.pdf', height = 4, width = 6)
p <- fviz_contrib(vq.pca, choice = "var", title = '', axes = 1) +
geom_text(aes(label = round(contrib, 2)), vjust = -1, size = 5) +
theme(axis.text = element_text(size = 15),
axis.title = element_text(size = 15)) +
ylim(0, 35)
p$layers[[2]] <- NULL
p
# dev.off()
# Subset for PCA
pca_df <- df %>% dplyr::select(H1c_scaled, H1H2c_scaled, H1A1c_scaled, H1A2c_scaled, H1A3c_scaled, CPP_scaled)
# Change column names
colnames(pca_df) <- c('H1*', 'H1* - H2*', 'H1* - A1*', 'H1* - A2*', 'H1* - A3*', 'CPP')
# Look at correlations (unncomment commands below if want to produce graphics)
#bitmap('vqual-corr.tiff', height = 8, width = 8, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-corr.eps", height = 8, width = 8, paper = 'special')
# pdf('vqual-corr.pdf', height = 8, width = 8)
png('vqual-corr.png', width=481, height=444, res=200)
corrplot(cor(pca_df), method = 'circle', diag = FALSE, type = 'upper', addCoef.col = 'black')
dev.off()
# Run PCA
vq.pca <- PCA(pca_df, graph = FALSE, ncp = 6)
# Scree plot (unncomment commands below if want to produce graphics)
#bitmap('vqual-scree.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-scree.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-scree.pdf', height = 4, width = 6)
fviz_screeplot(vq.pca, addlabels = FALSE, title = '') +
geom_text(aes(label = round(vq.pca$eig[, 2], 2)), size = 5, hjust = 0.1, vjust = -0.5) +
theme(text = element_text(size = 15)) +
ylim(0,45)
# dev.off()
# Contributions to dimension 1 (unncomment commands below if want to produce graphics)
#bitmap('vqual-dim1.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-dim1.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-dim1.pdf', height = 4, width = 6)
p <- fviz_contrib(vq.pca, choice = "var", title = '', axes = 1) +
geom_text(aes(label = round(contrib, 2)), vjust = -1, size = 5) +
theme(axis.text = element_text(size = 15),
axis.title = element_text(size = 15)) +
ylim(0, 35)
p$layers[[2]] <- NULL
p
# dev.off()
# Subset for PCA
pca_df <- df %>% dplyr::select(H1c_scaled, H1H2c_scaled, H1A1c_scaled, H1A2c_scaled, H1A3c_scaled, CPP_scaled)
# Change column names
colnames(pca_df) <- c('H1*', 'H1* - H2*', 'H1* - A1*', 'H1* - A2*', 'H1* - A3*', 'CPP')
# Look at correlations (unncomment commands below if want to produce graphics)
#bitmap('vqual-corr.tiff', height = 8, width = 8, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-corr.eps", height = 8, width = 8, paper = 'special')
# pdf('vqual-corr.pdf', height = 8, width = 8)
png('vqual-corr.png', width=481, height=444, res=150)
corrplot(cor(pca_df), method = 'circle', diag = FALSE, type = 'upper', addCoef.col = 'black')
dev.off()
# Run PCA
vq.pca <- PCA(pca_df, graph = FALSE, ncp = 6)
# Scree plot (unncomment commands below if want to produce graphics)
#bitmap('vqual-scree.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-scree.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-scree.pdf', height = 4, width = 6)
fviz_screeplot(vq.pca, addlabels = FALSE, title = '') +
geom_text(aes(label = round(vq.pca$eig[, 2], 2)), size = 5, hjust = 0.1, vjust = -0.5) +
theme(text = element_text(size = 15)) +
ylim(0,45)
# dev.off()
# Contributions to dimension 1 (unncomment commands below if want to produce graphics)
#bitmap('vqual-dim1.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-dim1.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-dim1.pdf', height = 4, width = 6)
p <- fviz_contrib(vq.pca, choice = "var", title = '', axes = 1) +
geom_text(aes(label = round(contrib, 2)), vjust = -1, size = 5) +
theme(axis.text = element_text(size = 15),
axis.title = element_text(size = 15)) +
ylim(0, 35)
p$layers[[2]] <- NULL
p
# dev.off()
# Subset for PCA
pca_df <- df %>% dplyr::select(H1c_scaled, H1H2c_scaled, H1A1c_scaled, H1A2c_scaled, H1A3c_scaled, CPP_scaled)
# Change column names
colnames(pca_df) <- c('H1*', 'H1* - H2*', 'H1* - A1*', 'H1* - A2*', 'H1* - A3*', 'CPP')
# Look at correlations (unncomment commands below if want to produce graphics)
#bitmap('vqual-corr.tiff', height = 8, width = 8, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-corr.eps", height = 8, width = 8, paper = 'special')
# pdf('vqual-corr.pdf', height = 8, width = 8)
png('vqual-corr.png', width=481, height=444, res=125)
corrplot(cor(pca_df), method = 'circle', diag = FALSE, type = 'upper', addCoef.col = 'black')
dev.off()
# Run PCA
vq.pca <- PCA(pca_df, graph = FALSE, ncp = 6)
# Scree plot (unncomment commands below if want to produce graphics)
#bitmap('vqual-scree.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-scree.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-scree.pdf', height = 4, width = 6)
fviz_screeplot(vq.pca, addlabels = FALSE, title = '') +
geom_text(aes(label = round(vq.pca$eig[, 2], 2)), size = 5, hjust = 0.1, vjust = -0.5) +
theme(text = element_text(size = 15)) +
ylim(0,45)
# dev.off()
# Contributions to dimension 1 (unncomment commands below if want to produce graphics)
#bitmap('vqual-dim1.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-dim1.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-dim1.pdf', height = 4, width = 6)
p <- fviz_contrib(vq.pca, choice = "var", title = '', axes = 1) +
geom_text(aes(label = round(contrib, 2)), vjust = -1, size = 5) +
theme(axis.text = element_text(size = 15),
axis.title = element_text(size = 15)) +
ylim(0, 35)
p$layers[[2]] <- NULL
p
# dev.off()
# Subset for PCA
pca_df <- df %>% dplyr::select(H1c_scaled, H1H2c_scaled, H1A1c_scaled, H1A2c_scaled, H1A3c_scaled, CPP_scaled)
# Change column names
colnames(pca_df) <- c('H1*', 'H1* - H2*', 'H1* - A1*', 'H1* - A2*', 'H1* - A3*', 'CPP')
# Look at correlations (unncomment commands below if want to produce graphics)
#bitmap('vqual-corr.tiff', height = 8, width = 8, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-corr.eps", height = 8, width = 8, paper = 'special')
# pdf('vqual-corr.pdf', height = 8, width = 8)
png('vqual-corr.png', width=481, height=444, res=125)
corrplot(cor(pca_df), method = 'circle', diag = FALSE, type = 'upper', addCoef.col = 'black')
dev.off()
# Run PCA
vq.pca <- PCA(pca_df, graph = FALSE, ncp = 6)
# Scree plot (unncomment commands below if want to produce graphics)
#bitmap('vqual-scree.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-scree.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-scree.pdf', height = 4, width = 6)
png('vqual-scree.png', width=756, height=445, res=125)
fviz_screeplot(vq.pca, addlabels = FALSE, title = '') +
geom_text(aes(label = round(vq.pca$eig[, 2], 2)), size = 5, hjust = 0.1, vjust = -0.5) +
theme(text = element_text(size = 15)) +
ylim(0,45)
dev.off()
# Contributions to dimension 1 (unncomment commands below if want to produce graphics)
#bitmap('vqual-dim1.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-dim1.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-dim1.pdf', height = 4, width = 6)
p <- fviz_contrib(vq.pca, choice = "var", title = '', axes = 1) +
geom_text(aes(label = round(contrib, 2)), vjust = -1, size = 5) +
theme(axis.text = element_text(size = 15),
axis.title = element_text(size = 15)) +
ylim(0, 35)
p$layers[[2]] <- NULL
p
# dev.off()
# Subset for PCA
pca_df <- df %>% dplyr::select(H1c_scaled, H1H2c_scaled, H1A1c_scaled, H1A2c_scaled, H1A3c_scaled, CPP_scaled)
# Change column names
colnames(pca_df) <- c('H1*', 'H1* - H2*', 'H1* - A1*', 'H1* - A2*', 'H1* - A3*', 'CPP')
# Look at correlations (unncomment commands below if want to produce graphics)
#bitmap('vqual-corr.tiff', height = 8, width = 8, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-corr.eps", height = 8, width = 8, paper = 'special')
# pdf('vqual-corr.pdf', height = 8, width = 8)
png('vqual-corr.png', width=481, height=444, res=125)
corrplot(cor(pca_df), method = 'circle', diag = FALSE, type = 'upper', addCoef.col = 'black')
dev.off()
# Run PCA
vq.pca <- PCA(pca_df, graph = FALSE, ncp = 6)
# Scree plot (unncomment commands below if want to produce graphics)
#bitmap('vqual-scree.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-scree.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-scree.pdf', height = 4, width = 6)
png('vqual-scree.png', width=756, height=445, res=125)
fviz_screeplot(vq.pca, addlabels = FALSE, title = '') +
geom_text(aes(label = round(vq.pca$eig[, 2], 2)), size = 5, hjust = 0.1, vjust = -0.5) +
theme(text = element_text(size = 15)) +
ylim(0,45)
dev.off()
# Contributions to dimension 1 (unncomment commands below if want to produce graphics)
#bitmap('vqual-dim1.tiff', height = 4, width = 6, units = 'in', type = 'tifflzw', res = 300)
#postscript("vqual-dim1.eps", height = 4, width = 6, paper = 'special')
# pdf('vqual-dim1.pdf', height = 4, width = 6)
png('vqual-dim1.png', width=756, height=445, res=125)
p <- fviz_contrib(vq.pca, choice = "var", title = '', axes = 1) +
geom_text(aes(label = round(contrib, 2)), vjust = -1, size = 5) +
theme(axis.text = element_text(size = 15),
axis.title = element_text(size = 15)) +
ylim(0, 35)
p$layers[[2]] <- NULL
p
dev.off()
vq.pca
vq.pca$var$coord
# Run PCA
vq.pca <- PCA(pca_df, graph = FALSE, ncp = 8)
# Correlation of VQ measures to PCA
vq.pca$var$coord
