美文网首页MATLAB编程
Data transfer from Stata to Matl

Data transfer from Stata to Matl

作者: alin009 | 来源:发表于2019-01-24 20:07 被阅读0次

OBJECTIVE

Provide 2 approaches to transfer data from Stata to Matlab

Method 1: by .csv file

In Stata:

use old.dta
outsheet * using new.csv , comma replace

In Matlab:

Tab = readtable('new.csv');

Method 2: by .json file

In Stata:

use old.dta
jsonio out, what(data) file(new.json)

jsonio donot support writing UTF-8 content to disk in some operations system.

In Matlab:

tmp = freadjson('new.json');
Tab = struct2table(tmp.data);

Reference

jsonio@git

相关文章

网友评论

    本文标题:Data transfer from Stata to Matl

    本文链接:https://www.haomeiwen.com/subject/ahbujqtx.html