I have been a long-time reader of Statalist and usually find what I need in the excellent trove of Q&A. But now, I ran into a problem where I found no answer – so this is my first post.
Here is the problem: I (quietly) run a constrained regression, looped over a few 100 sub-samples of a large data-set. In some cases, I need to display the contents of the constraints (they feed into a csv-type output in my log-file). So I define a local to hold them, but the display of negative values has proved tricky. This happens irrespective of whether I use decimal points or decimal commas. Here is a much abridged version of what I do:
Code:
. set dp period, perm (set dp preference recorded) . capture drop gender . gen gender = 0 . constraint define 1 gender = -.12345 . constraint get 1 . local cgender = r(contents) . display in smcl `cgender' 0-.12345 . set dp comma, perm (set dp preference recorded) . display in smcl `cgender' 0-,12345
Thanks a lot to anybody who can help!
Malte
0 Response to Displaying contents of a constraint: negative values shows up as "0-,12345" etc.
Post a Comment