Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Problem with ultraedit and comments


From   Neil Shephard <nshephard@nhs.net>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Problem with ultraedit and comments
Date   Thu, 25 Sep 2008 13:21:07 +0100

Beth Gifford wrote:
Hello there
I typically use ultraedit as my text editor. However if I copy and
paste from ultraedit to stata, stata will not recognize comments that
are written as /// or /* */
I've not used ultraedit (Emacs and ESS is my prefered poison), but what do you mean Stata will not recognize comments that are copy and pasted in?

If its a chunk of code with comments that your pasting in then its akin to typing them at Stata's prompt and you will get the same results. Copy and paste the following into Stata...

***eg.do***
sysuse auto, clear
/* Tabulate the mpg variable */
tab mpg
/// Regress weight and length on mpg
regress mpg weight length
*************

You'll get the results....
. sysuse auto, clear
(1978 Automobile Data)

. regress mpg weight length price

Source | SS df MS Number of obs = 74
-------------+------------------------------ F( 3, 70) = 46.63
Model | 1628.52531 3 542.841771 Prob > F = 0.0000
Residual | 814.934146 70 11.6419164 R-squared = 0.6665
-------------+------------------------------ Adj R-squared = 0.6522
Total | 2443.45946 73 33.4720474 Root MSE = 3.412

------------------------------------------------------------------------------
mpg | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
weight | -.0030371 .0017701 -1.72 0.091 -.0065675 .0004933
length | -.0965706 .057716 -1.67 0.099 -.2116815 .0185403
price | -.0001733 .0001676 -1.03 0.305 -.0005076 .000161
_cons | 49.68492 6.329089 7.85 0.000 37.06195 62.30789
------------------------------------------------------------------------------

. sysuse auto, clear
(1978 Automobile Data)

.
. /* Tabulate the mpg variable */
unrecognized command: / invalid command name
r(199);

.
. tab mpg

Mileage |
(mpg) | Freq. Percent Cum.
------------+-----------------------------------
12 | 2 2.70 2.70
14 | 6 8.11 10.81
15 | 2 2.70 13.51
16 | 4 5.41 18.92
17 | 4 5.41 24.32
18 | 9 12.16 36.49
19 | 8 10.81 47.30
20 | 3 4.05 51.35
21 | 5 6.76 58.11
22 | 5 6.76 64.86
23 | 3 4.05 68.92
24 | 4 5.41 74.32
25 | 5 6.76 81.08
26 | 3 4.05 85.14
28 | 3 4.05 89.19
29 | 1 1.35 90.54
30 | 2 2.70 93.24
31 | 1 1.35 94.59
34 | 1 1.35 95.95
35 | 2 2.70 98.65
41 | 1 1.35 100.00
------------+-----------------------------------
Total | 74 100.00

.
. /// Regress weight and length on mpg
unrecognized command: / invalid command name
r(199);

.
. regress mpg weight length

Source | SS df MS Number of obs = 74
-------------+------------------------------ F( 2, 71) = 69.34
Model | 1616.08062 2 808.040312 Prob > F = 0.0000
Residual | 827.378835 71 11.653223 R-squared = 0.6614
-------------+------------------------------ Adj R-squared = 0.6519
Total | 2443.45946 73 33.4720474 Root MSE = 3.4137

------------------------------------------------------------------------------
mpg | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
weight | -.0038515 .001586 -2.43 0.018 -.0070138 -.0006891
length | -.0795935 .0553577 -1.44 0.155 -.1899736 .0307867
_cons | 47.88487 6.08787 7.87 0.000 35.746 60.02374
------------------------------------------------------------------------------

.

So there are error messages about not recognising the comments.....

. ///
unrecognized command: / invalid command name
r(199);

. /*
unrecognized command: / invalid command name
r(199);

...but Stata soon gets over that and moves on to the next line of text that you've pasted.

This isn't really a problem (to my mind at least).

Neil

***********************************************************************
This message may contain confidential and privileged information.
If you are not the intended recipient you should not disclose, copy
or distribute information in this e-mail or take any action in reliance
on its contents. To do so is strictly prohibited and may be unlawful.
Please inform the sender that this message has gone astray before
deleting it. Thank you.

2008 marks the 60th anniversary of the NHS. It's an opportunity to pay
tribute to the NHS staff and volunteers who help shape the service, and
celebrate their achievements.

If you work for the NHS and would like an NHSmail email account, go
to: www.connectingforhealth.nhs.uk/nhsmail
***********************************************************************

*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index