Hi all,
I am using mkspline to create manually chosen knots for analysis. However, I got an error message if I ran the following code:
However, if I ran the following code, it works...
I really hope the approach with locals can work so that I will not need to manually copy and paste the values.
Any suggestions to fix the code will be highly appreciated!
Best,
Long
I am using mkspline to create manually chosen knots for analysis. However, I got an error message if I ran the following code:
Code:
cap drop ppcusp* _pctile earnings, nq(100) foreach a in 1 5 10 25 50 75 90 95 99 { local knlist "`knlist' " " r(r`a')" } disp `knlist' // this gives 120.95 793.51001 1783.34 4546.29 8707.8604 14286.59 21961.449 29073.65 57494.488 mkspline ppcusp = wpcaqe, cubic knots(`knlist') displayknots knots() invalid -- invalid numlist r(121);
Code:
mkspline ppcusp = wpcaqe, cubic knots (120.95 793.51001 1783.34 4546.29 8707.8604 14286.59 21961.449 29073.65 57494.488) displayknots
Any suggestions to fix the code will be highly appreciated!
Best,
Long
Comment