【问题标题】:Stata: error factor variables and time-series operators not allowedStata:不允许使用错误因子变量和时间序列运算符
【发布时间】:2013-04-06 16:44:40
【问题描述】:

我想将数据从 Stata 导出到 csv 文件中:

 outsheet "$dirLink/analysis.csv",  replace comma

但我收到以下错误消息:

 factor variables and time-series operators not allowed
 r(101);

我在网上找不到解决方案。感谢您的帮助。

以下是变量定义:

 tab0            str1   %9s                    
 linkid          float  %10.0g                 
 recid2          float  %9.0g                  
 recid1          float  %10.0g                 
 patient1        str28  %28s                   
 patient2        str9   %9s                    
 totwght         int    %10.0g                 
 status          str1   %9s                    
 fname           str13  %13s                   
 sname           str13  %13s                   
 doby            int    %10.0g                 
 cohort          str2   %9s    
 res1            str27  %27s                   
 res2            str29  %29s                   
 residence       str50  %50s   
 facility        str22  %22s                   
 maxwght         int    %10.0g  

【问题讨论】:

    标签: stata


    【解决方案1】:

    语法应该是

    outsheet using "$dirLink/analysis.csv",  replace comma
    

    也就是说,using 这个词是必需的。这在帮助中有记录:无需互联网搜索。确实,错误消息不透明,因为 Stata 猜测您正在尝试using 或变量列表以外的其他内容,其中任何一个都可能跟随outsheet

    附:在我对您之前的问题的回答中,我指出正确的拼写是 Stata:请参阅 http://www.stata.com/support/faqs/resources/statalist-faq/#spell 这仍然是正确的。

    【讨论】:

    • 感谢您的帮助,对于迟到的答复深表歉意。那时我不仅是 Stata 初学者,也是 SO 初学者。
    猜你喜欢
    • 1970-01-01
    • 2012-05-16
    • 1970-01-01
    • 1970-01-01
    • 2022-11-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多