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
cdfquantreg: Module for quantile regression models for doubly-bounded random variables with cdf-quantile distributionsDear Statalisters, I have contributed this module to SSC (thanks to Kit Baum): cdfquantreg: Stata mo…
Create an aggregate variable for which its observation is all the variable names that had a "yes"I have data formatted as in the dataex below. What I want is to create one variable that will combin…
Sorting duplicates in household IDSDear All, I've got repeated observations with thesame IDs. I want to keep only the first of the repe…
Appending multiple data files that contain string and numeric data typesHello, I'm quite new to Stata and need help with some code. The idea is that I would like to create …
model with endogenous dichotomous predictor of continuous dependent variableWhich Stata (v15.1) command should I use to estimate the following linear model: y = b0 + b1z + b2x…
Subscribe to:
Post Comments (Atom)
0 Response to Randomly assigning treatment at a proportion to a variable
Post a Comment