Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: syntax command


From   Christophe Kolodziejczyk <[email protected]>
To   [email protected]
Subject   Re: st: syntax command
Date   Thu, 15 Sep 2011 08:50:01 +0200

Hi
I can't see the mistake, but you should try to set trace on  (see the
manual for details) . One other suggestion if you haven't tried:
unless you want to program options, use args instead of syntax

args beta new rsq obs  cov sddep


Best
Christophe



2011/9/15 Richard Palmer-Jones <[email protected]>:
> 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)
> sddep(varname)
> * it just so happens the macro names in the syntax command are the
> same as in the data file
> ....
>
> end
>
> 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 ---
> r(101);
>
>
> I have tried quite a number of variants, following examples at
> "http://data.princeton.edu/stata/programming.aspx"; 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.
>
> Richard
> *
> *   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/
>

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index