I believe I encounter a bug, or other wise unexpected behavior when trying to use the command -mipolate- with the option spline.
Code:
clear
input float(x F1)
1 .11251517
1 .11251517
1.0512711 .11455433
1.0512711 .11455433
1.0512711 .11455433
1.105171 .
1.105171 .
1.2214028 .
1.2214028 .
1.2214028 .
1.2840254 .12402454
1.349859 .
1.6487212 .13951072
1.733253 .14320229
1.822119 .14712086
1.822119 .14712086
1.822119 .14712086
1.9155408 .15127993
1.9155408 .15127993
1.9155408 .15127993
1.9155408 .15127993
end
Code:
mipolate F1 x , gen(F2) spline
I also find that if i try to restrict the data using unique values of x, the mipolate does not interpolate where I think it should:
Code:
bysort x:gen n=_n
mipolate F1 x if n==1, gen(F3) spline
sort x n
list x n F1 F2 F3, sep(0)
+-------------------------------------------------+
| x n F1 F2 F3 |
|-------------------------------------------------|
1. | 1 1 .1125152 .11251517 .11251517 |
2. | 1 2 .1125152 .11251517 .11251517 |
3. | 1.051271 1 .1145543 .11455433 .11455433 |
4. | 1.051271 2 .1145543 .11455433 .11455433 |
5. | 1.051271 3 .1145543 .11455433 .11455433 |
6. | 1.105171 1 . . . |
7. | 1.105171 2 . . .1167151 |
8. | 1.221403 1 . . . |
9. | 1.221403 2 . . .12144209 |
10. | 1.221403 3 . . .12144209 |
11. | 1.284025 1 .1240245 .12402454 .12402454 |
12. | 1.349859 1 . . . |
13. | 1.648721 1 .1395107 .13951072 .13951072 |
14. | 1.733253 1 .1432023 .14320229 .14320229 |
15. | 1.822119 1 .1471209 .14712086 .14712086 |
16. | 1.822119 2 .1471209 .14712086 .14712086 |
17. | 1.822119 3 .1471209 .14712086 .14712086 |
18. | 1.915541 1 .1512799 .15127993 .15127993 |
19. | 1.915541 2 .1512799 .15127993 .15127993 |
20. | 1.915541 3 .1512799 .15127993 .15127993 |
21. | 1.915541 4 .1512799 .15127993 .15127993 |
+-------------------------------------------------+
Thank you
Fernando
0 Response to Problem interpolating data with mipolate with spline option
Post a Comment