Announcement

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

  • Stata 14 example dataset

    Dear Statalisters,

    I wonder if anyone can help me run the following script in Stata 14.0? The reason is that all the example data files from StataPress are still in Stata 13's format, and those few in Stata 14's format are using traditional English notation in all the strings and thus do not demonstrate the newly added Unicode features. Without a proper demonstration dataset for testing, the development of use14 will be slow, since I don't have access to Stata 14.

    Two years ago I had a similar request regarding example datasets for Stata 13 and received a number of responses from volunteers (thank you again!).

    I hope StataList forum preserves all the characters in the script below intact. Just in case, the same file is also posted here:
    http://www.radyakin.org/statalist/2015/gendata14.do

    You can use private messaging of this forum if you don't want to post the file into the thread for any reason.

    I would appreciate if you could further mention the producing version of Stata, such as "Stata 14.0MP2 build 123 from 01 april 2015 32-bit on Windows 7 64-bit".

    Thank you very much, Sergiy Radyakin


    Code:
    *** ===== beginning of file =======
    
    *** Please do not modify the program. Run as is.
    *** I am aware that there are two compress statements here and
    **  they are not in the end of the program. This is intended.
    
    version 14.0
    
    clear
    set obs 10
    generate s1="abcdefghijklmnopqrstuvwxyz"
    generate s2=s1*10
    generate byte region=_n
    
    label define регион 1 "Север" 2 "Запад" 3 "Юг" 4 "Восток" ///
                        5 "Центр" 6 "Все остальные" 7 "яΕἲς Ἑρμῆνя" ///
                        8 "東京、日本の首都" 9 "Не определено"
    
    label values region регион
    
    generate s3=s1+"Εἲς Ἑρμῆν"+"абвгдежзийклмнопрстуфхцчшщъыьэюя"+"Εἲς Ἑρμῆν"
    generate strL s4="АБВГДЕЖЗ"*500
    compress
    
    replace s4="Alpha & Omega" if mod(_n,2)==1
    char s4[комментарий] <<<Ἑρμῆν ὕμνει, Μοῦσα, Διὸς καὶ Μαιάδος υἱόν>>>
    compress
    
    replace s3="" in 5
    
    generate float regionfloat = 11-region
    label values regionfloat регион
    
    set seed 201781
    generate double ПеременнаяХранящаяСлучайноеЧисло=floor(runiform()*10000)/100
    format ПеременнаяХранящаяСлучайноеЧисло %6.2f
    
    char ПеременнаяХранящаяСлучайноеЧисло[комментарий] <<<Простой, понятный и хорошо заметный комментарий>>>
    
    note s1: First
    note s1: Second
    note s1: Третья
    note s1: 4th
    note s2: А-Я-а-я
    
    label variable s1 "東京、日本の首都"
    label variable s3 "Εἲς Ἑρμῆνабвгдежз東京、日本の首都"
    label variable region "РЕГИОН"
    label variable regionfloat "ТОЖЕ РЕГИОН"
    label variable ПеременнаяХранящаяСлучайноеЧисло "Метка переменной, которая хранит случайное число"
    label data "Проверка данных"
    
    *** ===== end of file ===========

  • #2
    Here you go, Sergiy. Good luck with use14.

    Code:
    Stata/MP 14.0 for Windows (64-bit x86-64)
    Revision 02 Apr 2015
    Copyright 1985-2015 StataCorp LP
    
    Total physical memory:     8269900 KB
    Available physical memory: 4429628 KB
    Run on Windows 7. I don't know how to find the build number for Stata. But the "File version" is 521.14.0.366 if that helps.
    Attached Files
    Last edited by Clyde Schechter; 12 Apr 2015, 15:21.

    Comment


    • #3
      Mac test attached; how do I find the build number?
      Attached Files
      __________________________________________________ __
      Assistant Professor, Department of Biostatistics and Epidemiology
      School of Public Health and Health Sciences
      University of Massachusetts- Amherst

      Comment


      • #4
        Dear Clyde, Andrew, thank you very much for helping out! The files are very useful indeed.

        The build number of Stata is stored in the last (4th) component of the version as reported by the file properties, so 366 in Clyde's case.

        Here is a helpful and detailed description by Alan Riley (StataCorp) .
        The shortest way to get it in Stata is usually type:
        Code:
        display c(compile_number)
        Compile number and build number are used interchangeably, though build number seems to be more frequent.

        Reporting the full number like Clyde did, allows identifying the binary executable producing the data file, in case there is any problem with it. First release of Stata 13 contained such a problem two years ago, and the patch to it was released (as far as I remember) still while the DVDs were about to be mailed to first customers. Subsequent batches of disks were shipped already patched. I have discovered that bug independently from StataCorp's fix, and -use13- was tolerant to it (could correctly identify affected data files and recover the data from them). Stata itself was also reading the data correctly and nothing was lost, except that if a third-party software follows the specification 117 up to the letter, it may fail to read such files. My patch use13_fix() was described here:
        http://www.statalist.org/forums/foru...6874#post26874

        Since modern Macs are running on the Intel CPUs the byte order in the Stata file is the same as in the one produced in Windows, so both files (submitted by Clyde and Andrew) are essentially the same (which is expected, because they are the product of the same program). If there is anyone running a HiLo (MSF) machine, and can run the suggested file for me, that would be great.

        Sincerely, Sergiy Radyakin

        Comment


        • #5
          Originally posted by Andrew Lover View Post
          Mac test attached; how do I find the build number?
          Compile number 367, FWIW.
          __________________________________________________ __
          Assistant Professor, Department of Biostatistics and Epidemiology
          School of Public Health and Health Sciences
          University of Massachusetts- Amherst

          Comment

          Working...
          X