Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Writing a macro variable into a csv file

    I specify here that i'm truly a neophyte in this language and i'm kind of struggling with easy stuff.
    What i want to do here is to do some test and then calculate how many times it takes to stata to do it. I want to report my result into a csv file.

    Code:
    import delimited "C:\Users\Olivier\Desktop\Zebrys\data\integ_narr_1_unif_bina_1.csv", encoding(Big5) 
    
    timer on 1 /*moyenne timer*/
    tabstat (v1-v128), stat(mean)
    timer off 1 
    
    timer on 2 /*median timer */
    tabstat (v1-v128), stats(median)
    timer off 2
    
    timer list 
    di `r(t1)'
    input str10 fichier  temps str10 action    
    "bina" `r(t1)' "mean"
    end
    
    export delimited fichier temps action using "cr_etape1", replace
    timer clear /* On vide le timer et la liste */
    
    clear
    And in fact Stata cannot read my variable, i obtain this error :
    '`' cannot be read as a number
    Thanks for your help

  • #2
    Welcome to Statalist.

    You have accidentally posted your topic in Statalist's Mata Forum, which is used for discussions of Stata's Mata language, which is different than Stata's command language, and different than Stata's matrix commands. Your question will see a more appropriate, and much larger audience if you post it in Statalist's General Forum.

    Comment

    Working...
    X