I have a question and hope you can help me. I am new in R and would like to simulate some data to practice. I would like to design a HLM, but I am overwhelmed at the moment.

I would like to simulate the following scenario: Suppose I want to measure the development of burnout in a company. My predictor for this is the general attachment style of the employees. So the thesis is that the attachment style (anxiety / avoidance) predicts the development of burnout at the workplace. Both values are recorded by questionnaire. I would now like to work with a nested structure.

Say we have 300 employees and 20 managers.

I would now like to examine the following hypothesis: The general characteristics of the attachment dimension "Avoiding" of supervisors predicts the burnout risk of employees. The higher the attachment avoidance among managers, the higher the risk of burnout among subordinates with anxious attachment style.

How can I do this? I have no idea. But I would like to understand how to do it.

Suppose I define the variables as follows and I want to achieve a great effect:

n = 300

n1= 20

Employee's fear of commitment to supervisor

attach_Cowork <- rnorm(n, mean = 3.56, sd = 1.12)

Avoidance of attachment Supervisor to employee

attach_avoi_SV <- rnorm(n1, mean = 2.92, sd = 1.19)

DV:

exhaustion <- rnorm(n, 22.19, 9.53)

What do I have to do? Can you help me?

Thanks a lot, Tom.