Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: error message- invalid syntax


From   "Michael Blasnik" <[email protected]>
To   <[email protected]>
Subject   st: Re: error message- invalid syntax
Date   Tue, 9 Nov 2004 10:53:28 -0500

see -help return-. It tells you that you need to tell Stata what kind of result to return. You probably want -return scalar bssamir =...

You can suppress the output of summarize using quietly (quietly summarize ....), or in the example you give, you can just use the meanonly option which automatically supresses the output (summairze ..., meanonly) and also works a little faster.

Michael Blasnik
[email protected]

----- Original Message ----- From: "samirkc" <[email protected]>
To: <[email protected]>
Sent: Tuesday, November 09, 2004 10:43 AM
Subject: st: error message- invalid syntax



dear statalisters,
I am trying to bootstrap the output (icer) of following program and i am writing program for the first time. But whenever i run this program by typing bssamir, it gives four tables of command summarize but at the end there is an error message " invalid syntax". The program goes like this:

program bssamir, rclass
version 8.2
summarize difqol if group == 0
local e0 = r(mean)
summarize difqol if group == 1
local e1 = r(mean)
summarize tcost if group == 0
local c0 = r(mean)
summarize tcost if group == 1
local c1 = r(mean)
return bssamir = (`c1' - `c0')/ (`e1' - `e0')
end

Please suggest what is wrong with my program. Also, how to run it without any output tables.
Thank you
Samir

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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