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
Rebalance Portfolios based on Annual Carbon Emission and Size TrecilesHi all! I need some help with figuring out how to calculate the portfolio returns. Below you can fi…
Merging does not have to be unique, is this possible?Hi, I am working with stata and i have a question so i can continue my thesis. I have got a dataset…
Combine graph plot yearsHi guys, I have 9 variables that I'd like to plot with tsline. The data is monthly and I am not abl…
Generate a variable with IF ANDI need to crate a variable with IF AND formula, but I did not find it in Stata. Could you please hel…
Gravity Model International TradeI am trying to estimate the gravity model of international trade using Fixed Effect Model. I have da…
Subscribe to:
Post Comments (Atom)
0 Response to Randomly assigning treatment at a proportion to a variable
Post a Comment