How to simulate correlations

Discuss statistics related things

by Vit » Fri Oct 16, 2020 7:06 am

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

by jonathon » Fri Oct 16, 2020 9:54 am

hi vit,

how about,

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
User avatar
jonathon
 
Posts: 1479
Joined: Fri Jan 27, 2017 10:04 am

by Vit » Fri Oct 16, 2020 10:37 am

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

by Vit » Mon Oct 19, 2020 7:23 am

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

by jonathon » Mon Oct 19, 2020 7:29 am

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
User avatar
jonathon
 
Posts: 1479
Joined: Fri Jan 27, 2017 10:04 am

by Vit » Mon Oct 19, 2020 8:43 am

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


Return to Statistics

cron