jeudi 4 avril 2019

Random number generation but common within group

Is there a way to generate random numbers from a distribution such that these numbers are common for rows within a group? Within an unbalanced panel, there is a household_id variable according to which I want to generate random numbers from truncated normal distribution using rtruncnorm.

Thank you.




Aucun commentaire:

Enregistrer un commentaire