Hi all,
I'm attempting to run the code below, but keep getting the following error message: [0.tteshift] not found
generate coef = .
generate se = .
levelsof tteshift, local(times)
foreach t of local times {
replace coef = _b[`t'.tteshift] if tteshift == `t'
replace se = _se[`t'.tteshift] if tteshift == `t'
}
----
For reference, "levelsof tteshift" produces the following output:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Additionally:
. summarize i.tteshift
Variable | Obs Mean Std. dev. Min Max
-------------+---------------------------------------------------------
tteshift |
0 | 1,326 .0007541 .0274618 0 1
1 | 1,326 .0007541 .0274618 0 1
2 | 1,326 .0007541 .0274618 0 1
3 | 1,326 .0015083 .0388221 0 1
4 | 1,326 .0022624 .0475292 0 1
-------------+---------------------------------------------------------
5 | 1,326 .0030166 .0548613 0 1
6 | 1,326 .0060332 .0774681 0 1
7 | 1,326 .0082956 .090736 0 1
8 | 1,326 .0113122 .1057955 0 1
9 | 1,326 .0120664 .1092235 0 1
-------------+---------------------------------------------------------
10 | 1,326 .0135747 .1157605 0 1
11 | 1,326 .015083 .121929 0 1
12 | 1,326 .0218703 .1463151 0 1
13 | 1,326 .0316742 .1751973 0 1
14 | 1,326 .0354449 .1849714 0 1
-------------+---------------------------------------------------------
15 | 1,326 .1915535 .393672 0 1
16 | 1,326 .0505279 .2191142 0 1
17 | 1,326 .0497738 .2175592 0 1
18 | 1,326 .0497738 .2175592 0 1
19 | 1,326 .0497738 .2175592 0 1
-------------+---------------------------------------------------------
20 | 1,326 .0490196 .2159904 0 1
21 | 1,326 .0482655 .2144075 0 1
22 | 1,326 .0475113 .2128101 0 1
23 | 1,326 .0444947 .2062693 0 1
24 | 1,326 .0422323 .2011945 0 1
-------------+---------------------------------------------------------
25 | 1,326 .0392157 .194181 0 1
26 | 1,326 .0384615 .1923802 0 1
27 | 1,326 .0369532 .1887182 0 1
28 | 1,326 .0354449 .1849714 0 1
29 | 1,326 .0286576 .1669053 0 1
-------------+---------------------------------------------------------
30 | 1,326 .0188537 .1360595 0 1
31 | 1,326 .015083 .121929 0 1
I've tried running the code in both a piecemeal fashion and in a single block as other users have suggested, but still no luck -- can't understand why 0.tteshift is "not found" when the variable does exist in my dataset. Any/all troubleshooting suggestions would be greatly appreciated!
I'm attempting to run the code below, but keep getting the following error message: [0.tteshift] not found
generate coef = .
generate se = .
levelsof tteshift, local(times)
foreach t of local times {
replace coef = _b[`t'.tteshift] if tteshift == `t'
replace se = _se[`t'.tteshift] if tteshift == `t'
}
----
For reference, "levelsof tteshift" produces the following output:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Additionally:
. summarize i.tteshift
Variable | Obs Mean Std. dev. Min Max
-------------+---------------------------------------------------------
tteshift |
0 | 1,326 .0007541 .0274618 0 1
1 | 1,326 .0007541 .0274618 0 1
2 | 1,326 .0007541 .0274618 0 1
3 | 1,326 .0015083 .0388221 0 1
4 | 1,326 .0022624 .0475292 0 1
-------------+---------------------------------------------------------
5 | 1,326 .0030166 .0548613 0 1
6 | 1,326 .0060332 .0774681 0 1
7 | 1,326 .0082956 .090736 0 1
8 | 1,326 .0113122 .1057955 0 1
9 | 1,326 .0120664 .1092235 0 1
-------------+---------------------------------------------------------
10 | 1,326 .0135747 .1157605 0 1
11 | 1,326 .015083 .121929 0 1
12 | 1,326 .0218703 .1463151 0 1
13 | 1,326 .0316742 .1751973 0 1
14 | 1,326 .0354449 .1849714 0 1
-------------+---------------------------------------------------------
15 | 1,326 .1915535 .393672 0 1
16 | 1,326 .0505279 .2191142 0 1
17 | 1,326 .0497738 .2175592 0 1
18 | 1,326 .0497738 .2175592 0 1
19 | 1,326 .0497738 .2175592 0 1
-------------+---------------------------------------------------------
20 | 1,326 .0490196 .2159904 0 1
21 | 1,326 .0482655 .2144075 0 1
22 | 1,326 .0475113 .2128101 0 1
23 | 1,326 .0444947 .2062693 0 1
24 | 1,326 .0422323 .2011945 0 1
-------------+---------------------------------------------------------
25 | 1,326 .0392157 .194181 0 1
26 | 1,326 .0384615 .1923802 0 1
27 | 1,326 .0369532 .1887182 0 1
28 | 1,326 .0354449 .1849714 0 1
29 | 1,326 .0286576 .1669053 0 1
-------------+---------------------------------------------------------
30 | 1,326 .0188537 .1360595 0 1
31 | 1,326 .015083 .121929 0 1
I've tried running the code in both a piecemeal fashion and in a single block as other users have suggested, but still no luck -- can't understand why 0.tteshift is "not found" when the variable does exist in my dataset. Any/all troubleshooting suggestions would be greatly appreciated!
Comment