Hello,
I'm conducting Stata command for randomization with the following details:
Treatment group : Control group = 1:1
Target sample : 32
Block size 4
1) Does command look okay?
2) There are two arms (1 or 2). Which of the two is the treatment group? 1 or 2?
If you help me, I would really appreciate it!!!!
. set obs 32
number of observations (_N) was 0, now 32
.
. egen arm = seq(), to(2)
.
. egen block = seq(), block(4)
.
. set seed 11
.
. gen random = uniform()
.
. bysort block (random): gen byte seqn = _n
.
. bysort block (seqn): l seqn arm
-----------------------------------------------------------------------------------------------
-> block = 1
+------------+
| seqn arm |
|------------|
1. | 1 1 |
2. | 2 1 |
3. | 3 2 |
4. | 4 2 |
+------------+
-----------------------------------------------------------------------------------------------
-> block = 2
+------------+
| seqn arm |
|------------|
1. | 1 1 |
2. | 2 2 |
3. | 3 2 |
4. | 4 1 |
+------------+
Related Posts with Inquiry about randomization (block size 4, 1:1 allocation)
Inserting value of a string in a filename when exportingIs there a way to pull the value of a string variable into the part of a collect export command so t…
Using framesI am using Stata MP 16.1 and I'm new to the frames command. Perhaps this goes into the wishlist for …
Replace/If StatementHello, I have a syntax issue that I need assistance with. I have a dataset with confirmed COVID cas…
How to save table from -pstest- command?Hi there, My goal is to save the table produced by the command -pstest-, preferably to word but I w…
Matched pairs based on three matching criteriaDear all, I have panel data of funds where one type of fund has received a "treatment" and the "con…
Subscribe to:
Post Comments (Atom)
0 Response to Inquiry about randomization (block size 4, 1:1 allocation)
Post a Comment