I have to create 2 variables
the first one is a random variable (e1) between 1-17
the second is a variable (e2) between 1-17 and with probability of 0.8.
But the condition of the second variable have to be < of e1
gen e1 = 0+int((17-0+1) * runiform())
gen e2 = rbinomial(16, 0.8)<e1
but e2 give me only 0 and 1
Thanks
Related Posts with Create a new variable with random probability and with probability
How to Create Ratio variable from independent variables for panel dataHi.. I am working on female and male tertiary enrolment rates and its impact on meritocracy. For the…
graph twoway rcap is misbehaving: a random space appears between ytitle and yaxisHello everyone, I wanted to produce same-size/same-format figures but for some reason, a random spa…
Interrater agreementDear all I have a dataset titled "readings". This consists of readings on the same XRays by 3 diffe…
asdoc update : addition of inspect commandThe latest version (Version 2.3.9.2 : Changes made on Nov 3, 2020) of asdoc can now export the outpu…
Removing middle character from a set of variablesHi everyone, This might have a simple solution but I'm stuck. I have a set of variables that goes …
Subscribe to:
Post Comments (Atom)
0 Response to Create a new variable with random probability and with probability
Post a Comment