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

st: RE: dolog with svyset


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: dolog with svyset
Date   Wed, 5 Jan 2005 20:50:37 -0000

-dolog- (Roger Newson, SSC etc.) sets -version- 
to 7. This seems to cause the problem in your 
case, as you get switched to an older version 
of -svyset-. You could experiment with cloning -dolog- 
and setting it to -version 8-. The clone is now
your program, not Roger's. 

Nick 
[email protected] 

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]On Behalf Of Danielle H
> Ferry
> Sent: 05 January 2005 18:47
> To: [email protected]
> Subject: st: dolog with svyset
> 
> 
> Hi all,
> I am having a problem using "dolog" when the "svyset" command is 
> contained in the do-file. You can see the error below. Does 
> anyone know 
> why this happens? It runs fine when I just type "do [filename]". Is 
> there a solution?
> Thanks,
> Danielle
> 
> 
> --------------------------------------------------------------
> -----------------
>         log:  D:\dhferry\cu_sph\churn\analysis\testdolog.log
>    log type:  text
>   opened on:   5 Jan 2005, 13:45:44
> - display "Log file `1'.log opened on $S_DATE at $S_TIME"
> = display "Log file testdolog.log opened on  5 Jan 2005 at 13:45:44"
> Log file testdolog.log opened on  5 Jan 2005 at 13:45:44
> - capture noisily do `0'
> = capture noisily do testdolog
> 
> . use ../gruntwork/churn, clear
> 
> .
> . egen psu = concat(dupersid panel)

< snip > 
> 
> . svyset [pw=panelwt], psu(psu)
>      ---------------------------------------------------------- begin 
> svyset ---
>      - version 8
>      - if _caller() < 8 {
>      - svyset_7 `0'
>      = svyset_7 [pw=panelwt], psu(psu)
>        ------------------------------------------------------ begin 
> svyset_7 ---
>        - version 6
>        - local keylist "pweight strata psu fpc"
>        - tokenize "`0'", parse(" ,")
>        = tokenize "[pw=panelwt], psu(psu)", parse(" ,")
>        - if "`1'"=="" | ("`1'"=="," & "`2'"=="") {
>        = if "[pw=panelwt]"=="" | ("[pw=panelwt]"=="," & ","=="") {
>          disp_key `keylist'
>          exit
>          }
>        - if "`1'"=="," {
>        = if "[pw=panelwt]"=="," {
>          if "`2'"=="clear" & "`3'"=="" {
>          clr_key `keylist'
>          exit
>          }
>          error 198
>          }
>        - local key "`1'"
>        = local key "[pw=panelwt]"
>        - macro shift
>        - chk_key `key' `keylist'
>        = chk_key [pw=panelwt] pweight strata psu fpc
>          -------------------------------------------- begin 
> svyset_7.chk_key ---
>          - args key
>          - local i 2
>          - while "``i''"!="" {
>          = while "pweight"!="" {
>          - if "`key'"=="``i''" {
>          = if "[pw=panelwt]"=="pweight" {
>            sret local WhichKey = `i' - 1
>            exit
>            }
>          - local i = `i' + 1
>          = local i = 2 + 1
>          - }
>          - while "``i''"!="" {
>          = while "strata"!="" {
>          - if "`key'"=="``i''" {
>          = if "[pw=panelwt]"=="strata" {
>            sret local WhichKey = `i' - 1
>            exit
>            }
>          - local i = `i' + 1
>          = local i = 3 + 1
>          - }
>          - while "``i''"!="" {
>          = while "psu"!="" {
>          - if "`key'"=="``i''" {
>          = if "[pw=panelwt]"=="psu" {
>            sret local WhichKey = `i' - 1
>            exit
>            }
>          - local i = `i' + 1
>          = local i = 4 + 1
>          - }
>          - while "``i''"!="" {
>          = while "fpc"!="" {
>          - if "`key'"=="``i''" {
>          = if "[pw=panelwt]"=="fpc" {
>            sret local WhichKey = `i' - 1
>            exit
>            }
>          - local i = `i' + 1
>          = local i = 5 + 1
>          - }
>          - while "``i''"!="" {
>          = while ""!="" {
>            if "`key'"=="``i''" {
>            sret local WhichKey = `i' - 1
>            exit
>            }
>            local i = `i' + 1
>            }
>          - di in red "keyword incorrect"
> keyword incorrect
>          - error 198
> invalid syntax
>          ---------------------------------------------- end 
> svyset_7.chk_key ---
>        -------------------------------------------------------- end 
> svyset_7 ---
>        Clear
>        exit
>        }
>      ------------------------------------------------------------ end 
> svyset ---
> r(198);
> 
> end of do-file

*
*   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