Hello, I am just starting to learn the stata software and I am trying to work through the stata lessons.
I am typing exactly what is written in the lesson - but I receive totally different results.
I type:
clear
set seed 100
set obs 10
generate famid = int(runiform()*4)
generate age = int(runiform()*10)
list
and I receive this:
+-------------+
| famid age |
|-------------|
1. | 3 9 |
2. | 1 1 |
3. | 3 5 |
4. | 0 4 |
5. | 3 5 |
6. | 1 6 |
7. | 3 1 |
8. | 2 2 |
9. | 3 8 |
10. | 3 0 |
+-------------+
instead I should receive this:
+-------------+
| famid age |
|-------------|
1. | 2 3 |
2. | 0 5 |
3. | 3 0 |
4. | 0 2 |
5. | 0 6 |
6. | 2 1 |
7. | 1 6 |
8. | 0 1 |
9. | 1 4 |
10. | 2 0 |
+-------------+
What am I doing wrong? I can not continue with the example if I generate these different results.
Thanks for you help - I really appreciate it!
I am typing exactly what is written in the lesson - but I receive totally different results.
I type:
clear
set seed 100
set obs 10
generate famid = int(runiform()*4)
generate age = int(runiform()*10)
list
and I receive this:
+-------------+
| famid age |
|-------------|
1. | 3 9 |
2. | 1 1 |
3. | 3 5 |
4. | 0 4 |
5. | 3 5 |
6. | 1 6 |
7. | 3 1 |
8. | 2 2 |
9. | 3 8 |
10. | 3 0 |
+-------------+
instead I should receive this:
+-------------+
| famid age |
|-------------|
1. | 2 3 |
2. | 0 5 |
3. | 3 0 |
4. | 0 2 |
5. | 0 6 |
6. | 2 1 |
7. | 1 6 |
8. | 0 1 |
9. | 1 4 |
10. | 2 0 |
+-------------+
What am I doing wrong? I can not continue with the example if I generate these different results.
Thanks for you help - I really appreciate it!

Comment