## How to simulate correlations

Discuss statistics related things

## How to simulate correlations

Hi there,

Simulating data is becoming more and more common practice for both teaching stats and research plannig. I highly appreciate that jamovi is capable of generating data of various distributions. But I would like to know whether there is a way to generate correlated data. Let's say I would like to generate a dataset with body height (normally distributed around mean of 175cm with SD=5cm) and body weight (normally distributed around mean of 75 kg with SD = 5kg), where the height and weight are positively correlated (r ~8; i.e. taller people are also heavier).

Is there some way other than writing R code?

If there isn't one, is it in the plan to provide jamovi user with some data simulation tool (a new module maybe) or tutorial on how to?

Thanks for keeping up the great work!
Vit

Posts: 31
Joined: Fri Apr 19, 2019 11:51 am

## Re: How to simulate correlations

hi vit,

variable height with the formula

NORM(175, 5)

variable weight with the formula

NORM(75, 5) + X * (height - VMEAN(height))

by varying the value of X, you can increase or decrease the strength of the correlation.

i'm not entirely sure how to achieve a specific correlation (i.e. 0.8 ...) i'd have to think about it, maybe write some formulas out, and i'm a bit too lazy for that at the moment.

but hopefully this is enough to get you started.

jonathon

jonathon

Posts: 1405
Joined: Fri Jan 27, 2017 10:04 am

## Re: How to simulate correlations

Jonathon, you are golden! Thank you very much. I'll tinker with the formula.
Vit

Posts: 31
Joined: Fri Apr 19, 2019 11:51 am

## Re: How to simulate correlations

If I may, I would like to develop on this.

Generating one set of data is great and all. I can design my analysis plan, see how data works perfectly. But I wondered whether there wouldn't be an option to prepare data simulation, choose a test and have this iterate for couple times. Effectively, have a "brute force" power analysis tool.

Does it make sense, is it doable and would it fit into jamovi development plan?
Vit

Posts: 31
Joined: Fri Apr 19, 2019 11:51 am

## Re: How to simulate correlations

hmm ... in general, there's a world of difference between a general idea, and a concrete proposal. the general idea seems ok, but i think once we begin nailing down specifics, i expect it would mean making pretty radical changes to the jamovi paradigm.

not sure.

jonathon

jonathon

Posts: 1405
Joined: Fri Jan 27, 2017 10:04 am

## Re: How to simulate correlations

I can (or maybe better I can't even) imagine the difficulties it would rise. It is just a brainstorming idea. I am more than thankful for what jamovi can do.
Vit

Posts: 31
Joined: Fri Apr 19, 2019 11:51 am