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" <>
To   <>
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

----- Original Message ----- From: "samirkc" <>
To: <>
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')

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

*   For searches and help try:

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