This article describes how to go from a traditional correspondence analysis:
To a 3D correspondence analysis visualization which allows you to view an extra dimension in your analysis.
- A Displayr document containing a traditional correspondence analysis.
1. Select Anything > Calculation > Custom Code.
2. Click onto the page to place the custom calculation.
3. Paste the following code into the R CODE section in the object inspector on the right.
rc = my.ca$row.coordinates
cc = my.ca$column.coordinates
p = plot_ly()
p = add_trace(p, x = rc[,1], y = rc[,2], z = rc[,3],
mode = 'text', text = rownames(rc),
textfont = list(color = "red"), showlegend = FALSE)
p = add_trace(p, x = cc[,1], y = cc[,2], z = cc[,3],
mode = "text", text = rownames(cc),
textfont = list(color = "blue"), showlegend = FALSE)
p <- config(p, displayModeBar = FALSE)
p <- layout(p, scene = list(xaxis = list(title = colnames(rc)),
yaxis = list(title = colnames(rc)),
zaxis = list(title = colnames(rc)),
aspectmode = "data"),
margin = list(l = 0, r = 0, b = 0, t = 0))
p$sizingPolicy$browser$padding <- 0
my.3d.plot = p
4. Replace my.ca in the first two lines of code with the name of your correspondence analysis. By default, it is called correspondence.analysis, but it can have numbers added to the end of the object name if you have created multiple correspondence analysis outputs. You can get the output name by clicking on the original correspondence analysis and then going to Properties > GENERAL > Name in the object inspector.
5. Click the Calculate button.
How to Do Traditional Correspondence Analysis
How to Add Images to a Correspondence Analysis Map
How to Do Correspondence Analysis of a Square Table
How to Create a Quality Table From a Correspondence Analysis
Article is closed for comments.