Public
Edited
Mar 6, 2023
Insert cell
Insert cell
workbook = FileAttachment("Data Repository.xlsx").xlsx()
Insert cell
data = workbook.sheet(3, {headers: true})
Insert cell
data
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import { corr } from '@fil/correlation-heatmap'
Insert cell
fields = ['Sex', 'Age', 'Sexual_Orientation', 'Coming_Out', 'Sexual_Litiation', 'No_of_Sexual_Partners', 'Sum_SS', 'Extraversion', 'Agreeableness', 'Conscientiousness', 'Emotional_Stability', 'Openness']
Insert cell
Insert cell
{
const list = d3.cross(fields, fields)
let corr_list = []
list.forEach(item => {
const [a,b] = item
corr_list.push({
a,
b,
value: corr(Plot.valueof(data_c, a), Plot.valueof(data_c, b)),
})
})
return corr_list.sort((a,b) => a.value - b.value).reverse().filter(d => d.value !== 1)
// return list.filter(d => list.find(d1 => d1.a === d.b && d1.b === d.a) !== -1)
// return corr_list
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more