2 years ago

#67722

test-img

SpiderRico

Generating correlated binary and normal variables in Python

I've a list of numbers, say T, where each element is sampled from a Normal Distribution.

I'd like to generate another list, say B, such that B and T has a particular correlation coefficient corr (supplied as an argument), and B consists of purely binary variables.

How can I do such a thing in Python?

python

statistics

normal-distribution

0 Answers

Your Answer

Accepted video resources