Hi guys,
I am having problems with providing a reproducible sample for my dataset.
I have a variable 'Firmsize' which groups observations based on the size of a firm. Now what i want is to get a specific number of random observations from each Firmsize-group. This does work (see the syntaxes below). But every time i run the syntaxes anew, i get different sample-observations, even though i have set the seed in the beginning of the sequence. I have tried a few different possibilities, like setting the seed before every sample-syntax, but these didn't work either. Have you guys got a suggestion on how to get a reproducible sample-dataset for this block of code?
Code:
sort Firmsize
set seed 6500
sample 395 if Firmsize==1, count by(ICMW)
sample 348 if Firmsize==2, count by(ICMW)
sample 295 if Firmsize==3, count by(ICMW)
sample 257 if Firmsize==4, count by(ICMW)
sample 212 if Firmsize==5, count by(ICMW)
sample 185 if Firmsize==6, count by(ICMW)
sample 150 if Firmsize==7, count by(ICMW)
sample 134 if Firmsize==8, count by(ICMW)
sample 103 if Firmsize==9, count by(ICMW)
sample 69 if Firmsize==10, count by(ICMW)
Thanks in advance!
Greetings,
Max
Related Posts with Getting reproducible sample-observations
'pvarirf' and 'pvarfevd' invalid in 'pvar' packageHello, I use the 'pvar' command to test the Pecking Order Theory for natural resource firms. It wor…
How to include in the same label differents coeffients of regression models?Hello, I have calculated four models and summarized them in a table. I am using the following progr…
twoway line - point connectionI trying to produce a twoway line graph that connects each point with a straight line. I'm getting a…
Pooled cross sectional regression analysisHi all, I have a dataset that looks like Code: * Example generated by -dataex-. To install: ssc …
-order(c.(A C B)#c.X) option does not work with esttab?Dear all, I use the following commands to make a table: eststo: reg Y c.(A B C)#c.X esttab, order(…
Subscribe to:
Post Comments (Atom)
0 Response to Getting reproducible sample-observations
Post a Comment