Hello. I have a variable X with, say, 10000 observations. I want to randomly assign a treatment value of 1 to this variable but cap the number of treatments to 50%, or 5000, observations. How can I do so in my do-file?
Thank you!
Related Posts with Randomly assigning treatment at a proportion to a variable
Probit regression coefficientsDear all, I have conducted a double-bounded contingent valuation study and analysed it in Stata with…
teffects - predict pscore, psI estimated the following model before estimating. I need to check the predicted propensity score mo…
cumulative sum that restarts at 0, if observe "0" in the original column.Hi, I have a simple question. I would like to have a cumulate sum that restarts if observing 0 in th…
Assign a label of a variable to a different variable Code: gen x = 1 label var x "this is x" gen y = 2 label var y "this is x" // <- how to automat…
elasticity- price, income etc. do i use a log-log model or employ mfx-eyex?Hi, I am very new to Stata so I apologise for the amateur-ness of my question. How do I calculate pr…
Subscribe to:
Post Comments (Atom)
0 Response to Randomly assigning treatment at a proportion to a variable
Post a Comment