Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: syntax command

From   Richard Palmer-Jones <>
Subject   st: syntax command
Date   Thu, 15 Sep 2011 00:16:18 +0100

Dear Readers

I am new to using the syntax command and am not having much success.So
help appreciated.

I have a data file with variables: beta rsq obs cov sddep, and want to
compute a new variable from them

program define myprogname
syntax varname, new(varname) rsq(varname) obs(varname)  cov(varname)
* it just so happens the macro names in the syntax command are the
same as in the data file


I call the program with

myprogname beta, new(smd) rsq(rsquare) nobs(nobs) ncov(ncov) sddep(sddepvar)

and get the error:

  - syntax varname, new(varname) rsq(varname) obs(varname)
cov(varname) sddep(varname)
factor variables and time-series operators not allowed
end myprogname ---

I have tried quite a number of variants, following examples at
""; and in t Chris
Baum's "introduction to Stata Programming" chapter 12, but with no
succes with either this form or an egen form of program.

Thanks in advance for help, and appologies for being unable to solve
this myself.

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index