I'm a newbie in R... I need to generate a variable Y such that if A = 1, Y takes the value 1 with probability 0.8, and if A = 0, then Y takes the value 1 with probability 0.2. I tried to generate the variable with the ifesle() function but I couldn't make it. Any help?
Aucun commentaire:
Enregistrer un commentaire